Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- data Node a = NodeEmpty | NodeSome (Node a) a (Node a)
- data Root a = RootEmpty | RootSome (Node a) a (Node a)
- data Tree = Root | Node
- whatNode :: Tree -> String
- whatNode RootEmpty = "empty root"
- whatNode RootSome {} = "some root"
- whatNode NodeEmpty = "empty node"
- whatNode NodeSome {} = "some node"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement