Skip to content

Instantly share code, notes, and snippets.

@diegs
Created May 29, 2014 16:31
Show Gist options
  • Select an option

  • Save diegs/5af77a47a95e91fcaf84 to your computer and use it in GitHub Desktop.

Select an option

Save diegs/5af77a47a95e91fcaf84 to your computer and use it in GitHub Desktop.
test1 :: String -> Maybe Integer
test1 "a" = Just 1
test1 _ = Nothing
test2 :: Integer -> Integer
test2 = (1+)
test3 :: String -> Maybe Integer
test3 = test2 <$> test1
test3' :: String -> Maybe Integer
test3' str = test2 <$> (test1 str)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment