Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- data MyNum = MyInteger Integer
- | MyDouble Double
- | MyRational Rational
- instance Eq MyNum where
- MyInteger _ == MyInteger _ = True
- MyInteger _ == _ = False
- MyDouble _ == MyDouble _ = True
- MyDouble _ == _ = False
- MyRational _ == MyRational _ = True
- MyRational _ == _ = False
- -- any (\x -> x == MyDouble 42) [MyInteger 1, MyInteger 2, MyDouble 3] == True
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement