#7026: Impredicative implicit parameters
----------------------------------------+-----------------------------------
Reporter: Ashley Yakeley | Owner:
Type: bug | Status: new
Priority: normal | Milestone: _|_
Component: Compiler (Type checker) | Version: 7.4.2
Keywords: | Os: Unknown/Multiple
Architecture: Unknown/Multiple | Failure: GHC rejects valid
program
Difficulty: Unknown | Testcase:
Blockedby: | Blocking:
Related: |
----------------------------------------+-----------------------------------
Comment(by Ashley Yakeley):
A nicer alternative to using a reader monad transformer is to use an
implicit parameter. In my Java VM project, I define this:
type VM a = (?jvmenv :: VMEnv) => IO a
So I can use this without any lifting. Ideally VM would act like a "real"
type wherever, but I run into this problem with a function that returns
"Maybe (VM t)".
There are a couple of possible workarounds of course, Pulling the implicit
parameter outside the "Maybe" might be acceptable, or else I can use some
kind of wrapper.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/7026#comment:2>
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