Skip to content

Instantly share code, notes, and snippets.



Created Oct 2, 2011
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