Reputation: 8724
I am using WinHugs98 and I would like to do simple XOR of Int 10 with Int 11.
How do I do it?
Current Attempt:
Hugs> :l Data.Bits
Data.Bits> (Bits 10) `xor` (Bits 11)
ERROR - Undefined data constructor "Bits"
How do I convert the integer 10 and 11 to a "Bits" type so it can be used? Then I want to convert back to print on screen.
Edit for Louise Wasserman:
Upvotes: 1
Views: 191
Reputation: 198063
There is no conversion to be done. Int
is an instance of the Bits
class, meaning the methods from Bits
are defined for Int
. Just use xor
directly:
10 `xor` 11
Upvotes: 3