File tree Expand file tree Collapse file tree 3 files changed +6
-6
lines changed
Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ lastv v1 v2 =
4949 (Beta , SemVer _ _ _) -> v2
5050 (SemVer x1 _ _, SemVer x2 _ _) | x1 < x2 -> v2
5151 (SemVer x1 y1 _, SemVer x2 y2 _) | x1 == x2 && y1 < y2 -> v2
52- _ -> error " I'm too lazy "
52+ _ -> error " TODO "
5353
5454data Sign = Negative | Zero | Positive
5555
@@ -89,14 +89,13 @@ instance Functor Tree where
8989 fmap f (Node x children) = Node (f x) (map (fmap f) children)
9090
9191
92- -- | 'Word16' is a zero or positive number
93- data Operation = Debit Word16 | Credit Word16
94-
92+ data Operation = Debit Int | Credit Int
93+ balance = undefined
9594
9695wordCount :: [[String ]] -> Int
9796wordCount files = foldr (\ words soFar -> (length words ) + soFar) 0 files
9897
99- balance' :: [Operation ] -> Word16
98+ balance' :: [Operation ] -> Int
10099balance' = foldr (\ op soFar -> toInt op + soFar) 0
101100 where
102101 toInt = \ case Debit x -> - x; Credit x -> x
Original file line number Diff line number Diff line change @@ -287,7 +287,7 @@ instance Functor Tree where
287287foldr :: Foldable t => (a -> b -> b) -> b -> t a -> b
288288```
289289
290- <!-- exdown-skip 1 2 7 8 -->
290+ <!-- exdown-skip 1 2 5 6 -->
291291``` hs
292292wordCount :: [[String ]] -> Int
293293wordCount files = undefined
Original file line number Diff line number Diff line change 1313 hs_module_name=${hs_module_name^} # Put first character uppercase
1414 f_hs=" ${hs_module_name} .hs"
1515 rm -Rf " $f_hs "
16+ echo " $EXDOWN -f hs $f > $f_hs "
1617 $EXDOWN -f hs $f > " $f_hs " || exit 1 # exdown is https://github.com/smelc/exdown
1718 echo " Written $f_hs "
1819done
You can’t perform that action at this time.
0 commit comments