Created
April 12, 2012 23:52
-
-
Save dcolish/2371969 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| data Tree' a = E' | Tree' (Tree' a) a (Tree' a) | |
| foo' = Tree' E' 0 E' | |
| foo = Tree' (Tree' E' 1 E' ) 0 (Tree' E' 1 (Tree' E' 0 E')) | |
| foo'' = Tree' E' 0 (Tree' E' 1 E') | |
| height t = case t of | |
| E' -> 0 | |
| Tree' s1 x s2 -> if h1 > h2 then h1 + 1 else h2 + 1 | |
| where | |
| h1 = height s1 | |
| h2 = height s2 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment