Advertisement
Guest User

Untitled

a guest
Jun 1st, 2021
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. data Node a = NodeEmpty | NodeSome (Node a) a (Node a)
  2. data Root a = RootEmpty | RootSome (Node a) a (Node a)
  3. data Tree = Root | Node
  4.  
  5. whatNode :: Tree -> String
  6. whatNode RootEmpty = "empty root"
  7. whatNode RootSome {} = "some root"
  8. whatNode NodeEmpty = "empty node"
  9. whatNode NodeSome {} = "some node"
  10.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement