Skip to content

Instantly share code, notes, and snippets.

@robertpfeiffer
Created July 15, 2009 12:00
Show Gist options
  • Save robertpfeiffer/147664 to your computer and use it in GitHub Desktop.
Save robertpfeiffer/147664 to your computer and use it in GitHub Desktop.
data Animal food = Animal String
data Carnivorous = Meat | The (Animal Herbivorous)
data Herbivorous = Plant
gnu::(Animal Herbivorous)
gnu = Animal "gnu"
wolf::(Animal Carnivorous)
wolf = Animal "wolf"
eat::(Animal a) -> a -> String
eat animal food = "mjam mjam"
-- gnu `eat` Plant
-- wolf `eat` (The gnu)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment