Created
October 30, 2012 02:11
-
-
Save kazu-yamamoto/3977911 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 Bin a = Bin a a deriving Show | |
data List a = Nil | Cons a (List (Bin a)) deriving Show | |
len :: List a -> Int | |
len Nil = 0 | |
len (Cons _ t) = 1 + 2 * len t |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment