I am trying to make a small haskell program that defines all logic gates AND, OR, NAND, NOR, XOR, NOT
For some reason the not function works on its own, but when i put it with the following code below, i get the following error. i have tried everything, and googled alot, but haskell is not that popular on the search engines
I would be greatful if someone could help me on this, thanks in advance
Syntax error in input (unexpected `=`)
> and :: Bool -> Bool -> Bool > and a b = a&&b > or :: Bool -> Bool -> Bool > or a b = a||b > not :: Bool -> Bool > not True = False > not False = True > nand :: Bool -> Bool -> Bool > nand a b = not ( a `and` b ) > nor :: Bool -> Bool -> Bool > nor a b = not ( a `and` b ) > xor :: Bool -> Bool -> Bool > xor a b = ( a `or` b ) `and` (not ( a `and` b ))

Sign In
Register
Help

MultiQuote