[GHC] #13774: Singletons code fails to typecheck when type signature involving type family is added
GHC
ghc-devs at haskell.org
Mon Jun 5 08:53:18 UTC 2017
#13774: Singletons code fails to typecheck when type signature involving type
family is added
-------------------------------------+-------------------------------------
Reporter: RyanGlScott | Owner: (none)
Type: bug | Status: closed
Priority: normal | Milestone:
Component: Compiler (Type | Version: 8.0.1
checker) | Keywords: FunDeps,
Resolution: invalid | TypeFamilies
Operating System: Unknown/Multiple | Architecture:
Type of failure: GHC rejects | Unknown/Multiple
valid program | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Changes (by simonpj):
* status: new => closed
* resolution: => invalid
Comment:
Your type signature
{{{
sT2 :: Sing (L2r 'False)
}}}
means
{{{
sT2 :: forall k. Sing k (L2r Bool k 'False)
}}}
And, since `k` is universally quantified, we can't unify it with `Nat`. So
the instance doesn't match.
You can fix it thus
{{{
sT2 :: Sing (L2r 'False :: Nat)
}}}
which indeed compiles fine.
I'm not sure what other error message would be better. I'll close as
invalid for now.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13774#comment:3>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list