Skip to content

Instantly share code, notes, and snippets.

@pedrofurla
Created December 22, 2013 20:58
Show Gist options
  • Select an option

  • Save pedrofurla/8088366 to your computer and use it in GitHub Desktop.

Select an option

Save pedrofurla/8088366 to your computer and use it in GitHub Desktop.
Is Misty ((->) t) banana right?
class Misty m where
banana :: (a -> m b) -> m a -> m b
unicorn :: a -> m a
-- Exercise 6
-- Relative Difficulty: 3
-- (use banana and/or unicorn)
furry' :: (a -> b) -> m a -> m b
furry' = banana . (unicorn .)
instance Misty ((->) t) where
banana f m = \t → f (m t) t
unicorn a = \t → a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment