[Haskell-cafe] Question on "case x of g" when g is a function

Salvador Lucas slucas at dsic.upv.es
Thu Jan 27 04:59:28 EST 2005

Because both bit0 and bit1 are free *local* variables
within the case expression. So, they have nothing
to do with your defined functions bit0 and bit1.

Best regards,


yeoh at cs.wisc.edu wrote:

>Can a kind soul please enlighten me on why f bit0 and f bit1 
>both return 0?
>>bit0     = False
>>bit1     = True
>>f x = case x of
>>        bit0 -> 0
>>        bit1 -> 1
>Haskell-Cafe mailing list
>Haskell-Cafe at haskell.org

More information about the Haskell-Cafe mailing list