@@ -1,7 +1,7 @@
11
22module Either where
33
4−import List (filter, partition)
4+import List
55
66data Either a b = Left a | Right b
77
@@ -9,18 +9,18 @@ either : (a -> c) -> (b -> c) -> Either a b -> c
99either f g e = case e of { Left x -> f x ; Right y -> g y }
1010
1111
12−isLeft : Either a b -> Bool
13−isLeft e = case e of { Left _ -> True ; _ -> False }
12+isLeft : Either a b -> Bool
13+isLeft e = case e of { Left _ -> True ; _ -> False }
1414
1515isRight : Either a b -> Bool
1616isRight e = case e of { Right _ -> True ; _ -> False }
1717
1818
19−lefts : [Either a b] -> [a]
20−lefts = filter isLeft
19+--lefts : [Either a b] -> [a]
20+lefts es = List.filter isLeft es
2121
22−rights : [Either a b] -> [b]
23−rights = filter isRight
22+--rights : [Either a b] -> [b]
23+rights es = List.filter isRight es
2424
25−partition : [Either a b] -> ([a],[b])
26−partition = partition isLeft
25+--partition : [Either a b] -> ([a],[b])
26+partition es = List.partition isLeft es