on master help sign in
Stop using function composition for no good reason
74b1b11Evan Czaplicki
libraries/Maybe.elm+2−2
@@ -12,7 +12,7 @@ module Maybe (Maybe(..), maybe, isJust, isNothing, justs) where
12@docs justs
12@docs justs
13-}
13-}
14
14
15−import Basics (not, (.))
15+import Basics (not)
16import List (foldr, (::))
16import List (foldr, (::))
17
17
18{-| The Maybe datatype. Useful when a computation may or may not
18{-| The Maybe datatype. Useful when a computation may or may not
@@ -52,7 +52,7 @@ isJust = maybe False (\_ -> True)
52 isNothing Nothing == True
52 isNothing Nothing == True
53-}
53-}
54isNothing : Maybe a -> Bool
54isNothing : Maybe a -> Bool
55−isNothing = not . isJust
55+isNothing m = not (isJust m)
56
56
57cons : Maybe a -> [a] -> [a]
57cons : Maybe a -> [a] -> [a]
58cons mx xs = maybe xs (\x -> x :: xs) mx
58cons mx xs = maybe xs (\x -> x :: xs) mx