Skip to content

Instantly share code, notes, and snippets.

@diegoeche

diegoeche/tmp.hs

Created Oct 2, 2011
Embed
What would you like to do?
-- Using Applicative
weakTo :: Monster -> Maybe Element
weakTo m = succ <$> elemType m
-- Using functors
weakTo' :: Monster -> Maybe Element
weakTo' m = succ `fmap` elemType m
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment