on master help sign in
Stop depending on Basics
2868ecdEvan Czaplicki
libraries/Maybe.elm+1−3
@@ -12,8 +12,6 @@ module Maybe (Maybe(..), maybe, isJust, isNothing, map) where
12@docs map
12@docs map
13-}
13-}
14
14
15−import Basics (not, (.))
16−
17{-| The Maybe datatype. Useful when a computation may or may not
15{-| The Maybe datatype. Useful when a computation may or may not
18result in a value (e.g. logarithm is defined only for positive
16result in a value (e.g. logarithm is defined only for positive
19numbers).
17numbers).
@@ -49,7 +47,7 @@ isJust = maybe False (\_ -> True)
49 isNothing Nothing == True
47 isNothing Nothing == True
50-}
48-}
51isNothing : Maybe a -> Bool
49isNothing : Maybe a -> Bool
52−isNothing = not . isJust
50+isNothing = maybe True (\_ -> False)
53
51
54{-| Transform the contents of a `Maybe` with a given function:
52{-| Transform the contents of a `Maybe` with a given function:
55
53