How to XOR two integers?

Hans Aberg haberg@matematik.su.se
Thu, 6 Sep 2001 22:01:29 +0200


At 15:52 +0530 2001/09/06, shameem@cse.iitb.ac.in wrote:
>import Int
>z = xor (intToInt32 0xf32e) (intToInt32 0xac43)
>The system gives the following error message:
>ERROR test.hs:5 - Undefined variable "xor"
...
>However when I directly input the expression
>Int> (xor (intToInt32 0xf32e) (intToInt32 0xac43))
>I get the answer
>24429

In the latter case you are inside the module Int, and sees all it has, but
the the former case you only see what the Int module exports. So if the Int
module contains xor but does not export it, you would end up on the
situation you describe.

  Hans Aberg