#4851: NoImplicitPrelude does not handle rec / mfix / ArrowLoop properly
---------------------------------+------------------------------------------
Reporter: peteg | Owner:
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 6.12.3
Keywords: | Testcase:
Blockedby: | Difficulty:
Os: Unknown/Multiple | Blocking:
Architecture: Unknown/Multiple | Failure: GHC rejects valid program
---------------------------------+------------------------------------------
Changes (by simonpj):
* cc: r...@… (added)
Comment:
I'm not sure what you are asking here. With HEAD (and hence I think 7.0)
we get
{{{
T4851.hs:10:4:
Ambiguous type variable `a' in the constraint:
(ArrowLoop a) arising from a proc expression
Possible cause: the monomorphism restriction applied to the following:
garbage :: forall t b. a t b (bound at T4851.hs:9:1)
Probable fix: give these definition(s) an explicit type signature
or use -XNoMonomorphismRestriction
In the expression:
proc b -> do { rec {(c, d) <- undefined -< (b, d)};
returnA -< c }
In an equation for `garbage':
garbage
= proc b -> do { rec {(c, d) <- undefined -< (b, d)};
returnA -< c }
}}}
But in HEAD, you need `RebindableSyntax` to get rebindable syntax.
(`NoImplicitPrelude` alone now does only what it says.)
With HEAD and `RebindableSyntax` we get
{{{
T4851.hs:11:9: Not in scope: `mfix'
}}}
which is reasonable; I believe `mfix` is defined in `Control.Monad.Fix`.
If we import that module too we get the ambiguous-variable error again.
Maybe you are asking a library question, like where is `mfix` defined?
Anyway, GHC seems to be behaving ok
Simon
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/4851#comment:1>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs