Created
May 12, 2017 13:00
-
-
Save yasuabe/9068dbdfa327070ea3dc6b6ffc1cc193 to your computer and use it in GitHub Desktop.
haskell implementation of simpath: Common
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Simpath.Common where | |
justIf :: Bool -> a -> Maybe a | |
justIf b a = if b then Just a else Nothing | |
mapOrElse :: (a -> b) -> b -> Maybe a -> b | |
mapOrElse f b ma = case ma of { Just a -> f a; _ -> b } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment