Advertisement
banovski

Foolean values

Nov 20th, 2021 (edited)
1,439
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. data Foo
  2.   = Bar
  3.   | Baz
  4.   deriving (Show)
  5.  
  6. fNot :: Foo -> Foo
  7. fNot Baz = Bar
  8. fNot Bar = Baz
  9.  
  10. fAnd :: Foo -> Foo -> Foo
  11. fAnd Bar Bar = Bar
  12. fAnd Bar Baz = Baz
  13. fAnd Baz Bar = Baz
  14. fAnd Baz Baz = Baz
  15.  
  16. fOr :: Foo -> Foo -> Foo
  17. fOr Bar Bar = Bar
  18. fOr Bar Baz = Bar
  19. fOr Baz Bar = Bar
  20. fOr Baz Baz = Baz
  21.  
  22. fXor :: Foo -> Foo -> Foo
  23. fXor Bar Bar = Baz
  24. fXor Bar Baz = Bar
  25. fXor Baz Bar = Bar
  26. fXor Baz Baz = Baz
  27.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement