[GHC] #12784: Typechecker regression in GHC 8.0.2 involving DefaultSignatures
GHC
ghc-devs at haskell.org
Tue Nov 29 17:01:44 UTC 2016
#12784: Typechecker regression in GHC 8.0.2 involving DefaultSignatures
-------------------------------------+-------------------------------------
Reporter: RyanGlScott | Owner:
Type: bug | Status: new
Priority: highest | Milestone: 8.0.2
Component: Compiler | Version: 8.1
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
Type of failure: GHC rejects | Unknown/Multiple
valid program | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s): Phab:D2682
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by rwbarton):
I like that your proposal is clear on the status of a program like
{{{
class Monad m => MonadSupply m where
fresh :: m Integer
default fresh :: (Monad n, MonadTrans t) => t n Integer -- NB: not m
fresh = lift fresh
}}}
which does seem like a reasonable attempt at writing a correct default
signature. But it's not obvious how to type check in the presence of what
amount to two type signatures for the same declaration.
On the other hand, it's mildly unsatisfactory that in order to write your
recommended version, you need to enable another language extension that in
turn enables `MonoLocalBinds` by default, which can affect unrelated
declarations in the module. It feels like the use of type equalities here
is fairly mild and shouldn't logically entail the need for reasoning about
local type equalities in pattern matches and so on.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12784#comment:18>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list