Guest User

Untitled

a guest
May 27th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. data NativeType = WyString String
  2. | WyInt Integer
  3. | WyBool Bool
  4. | WyList [NativeType]
  5. | WyMap (M.Map String NativeType)
  6. | WyId String
  7. | WyApplic [NativeType]
  8. deriving Show
  9.  
  10. instance Eq NativeType where
  11. (WyString s1) == (WyString s2) = s1 == s2
  12. (WyInt i1) == (WyInt i2) = i1 == i2
  13. (WyBool b1) == (WyBool b2) = b1 == b2
  14. (WyList l1) == (WyList l2) = l1 == l2
  15. (WyMap m1) == (WyMap m2) = m1 == m2
  16. (WyId i1) == (WyId i2) = i1 == i2
  17. (WyApplic a1) == (WyApplic a2) = a1 == a2
  18.  
  19. instance Ord NativeType where
  20. compare (WyString s1) (WyString s2) = compare s1 s2
  21. compare (WyInt s1) (WyInt s2) = compare s1 s2
  22. compare (WyBool s1) (WyBool s2) = compare s1 s2
  23. ...
Add Comment
Please, Sign In to add comment