Created
February 11, 2016 11:01
-
-
Save kseo/cdcca62aaf4623a57d8b to your computer and use it in GitHub Desktop.
Nested types
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
{-# LANGUAGE FlexibleContexts #-} | |
data BinaryTree a = Leaf | |
| InternalNode (BinaryTree a) a (BinaryTree a) deriving Show | |
data CompleteBinaryTree a = Leaves | |
| NonLeaves a (CompleteBinaryTree (a,a)) deriving Show | |
data AList a b = Nil | |
| Cons a (AList b a) deriving Show |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment