Commit 50fc08ae by Stuart Kurtz

Day 18, now with corrected comment

parent caf11616
Showing with 6 additions and 6 deletions
...@@ -34,9 +34,9 @@ explode sn = case iter 1 sn of ...@@ -34,9 +34,9 @@ explode sn = case iter 1 sn of
Nothing -> Nothing Nothing -> Nothing
Just (result, _, _) -> Just result Just (result, _, _) -> Just result
where where
-- the second coordinate of the result encodes whether a -- The outer Maybe wrapper encodes if a reduction occurred, and the
-- reduction occured, and if so, what numbers might need to -- inner Maybe wrappers encode if a number need to be added to the
-- be added to the left or right. -- left and/or right sides of the number being constructed.
iter :: Int -> SFNumber -> Maybe (SFNumber, Maybe Int, Maybe Int) iter :: Int -> SFNumber -> Maybe (SFNumber, Maybe Int, Maybe Int)
iter _ (Regular _) = Nothing iter _ (Regular _) = Nothing
iter 5 (Pair (Regular x) (Regular y)) = iter 5 (Pair (Regular x) (Regular y)) =
......
...@@ -35,9 +35,9 @@ explode sn = case iter 1 sn of ...@@ -35,9 +35,9 @@ explode sn = case iter 1 sn of
Nothing -> Nothing Nothing -> Nothing
Just (result, _, _) -> Just result Just (result, _, _) -> Just result
where where
-- the second coordinate of the result encodes whether a -- The outer Maybe wrapper encodes if a reduction occurred, and the
-- reduction occured, and if so, what numbers might need to -- inner Maybe wrappers encode if a number need to be added to the
-- be added to the left or right. -- left and/or right sides of the number being constructed.
iter :: Int -> SFNumber -> Maybe (SFNumber, Maybe Int, Maybe Int) iter :: Int -> SFNumber -> Maybe (SFNumber, Maybe Int, Maybe Int)
iter _ (Regular _) = Nothing iter _ (Regular _) = Nothing
iter 5 (Pair (Regular x) (Regular y)) = iter 5 (Pair (Regular x) (Regular y)) =
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment