Created
November 7, 2014 23:28
-
-
Save jagajaga/7f494f57ee0fe42363eb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class HasHeight a where | |
height :: a -> Int | |
data Tree = Leaf | Node {_height :: Int} | |
instance HasHeight Tree where | |
height Leaf = 0 | |
height a = _height a |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment