[Haskell] Perhaps a bug in GHC 6.10
walkiner at eecs.oregonstate.edu
Wed Dec 3 09:19:45 EST 2008
It looks like the 6.10 behavior is actually the correct one:
Also, see the do-notation translation section in the Haskell 98 Report:
On Wed, Dec 3, 2008 at 5:45 AM, Krasimir Angelov <kr.angelov at gmail.com> wrote:
> One of my students wrote code like this:
> prop_blank s (i,j) li =
> if i==li
> do if something then True else False
> prop_blank (...) (i,j) (li+1)
> This code is not accepted from GHC 6.8.3 because Bool is not a monad.
> In particular the error message is:
> Couldn't match expected type `Bool' against inferred type `a b'
> In the expression:
> Surprisingly the same code is accepted from GHC 6.10. This looks like
> a bug for me. The easiest way to reproduce this is to try to evaluate:
>> do True
> in GHCi with GHC 6.8.3 and with GHC 6.10
> Is there any reason to accept this code?
> Haskell mailing list
> Haskell at haskell.org
More information about the Haskell