Last active
August 29, 2015 14:21
-
-
Save khajavi/6d86e8ed101b5ce17c1f to your computer and use it in GitHub Desktop.
My Haskell Practices
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
> Constructor "Milad" | |
> Constructor [Just True, Nothing, Just False] |
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 MyList a = Constructor a (MyList a) | |
| Nil | |
deriving (Show) | |
fromList (x:xs) = Constructor x (fromList xs) | |
fromList [] = Nil | |
binaryTree Tree a = Node a (Tree a) (Tree a) | |
| Empty | |
deriving (Show) | |
bTree = Node "parent" (Node "left" Empty Empty) (Node "rigth" Empty Empty) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment