Skip to content

Instantly share code, notes, and snippets.

@akoppela
Last active February 5, 2018 07:13
Show Gist options
  • Save akoppela/ae7f12fb1a4a40ee9e1994697837300f to your computer and use it in GitHub Desktop.
Save akoppela/ae7f12fb1a4a40ee9e1994697837300f to your computer and use it in GitHub Desktop.
{-| Returns just true if given maybe is just something.
Otherise returns just false if given maybe is nothing.
maybeAndToBool (Just 42) == Just True
maybeAndToBool Nothing == Just False
-}
maybeAndToBool : Maybe a -> Maybe Bool
maybeAndToBool maybe =
case maybe of
Just _ ->
Just True
Nothing ->
Just False
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment