Skip to content

Instantly share code, notes, and snippets.

@khajavi
Last active August 29, 2015 14:21
Show Gist options
  • Save khajavi/6d86e8ed101b5ce17c1f to your computer and use it in GitHub Desktop.
Save khajavi/6d86e8ed101b5ce17c1f to your computer and use it in GitHub Desktop.
My Haskell Practices
> Constructor "Milad"
> Constructor [Just True, Nothing, Just False]
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