[GHC] #15592: Type families without CUSKs cannot be given visible kind variable binders
GHC
ghc-devs at haskell.org
Mon Sep 3 13:02:38 UTC 2018
#15592: Type families without CUSKs cannot be given visible kind variable binders
-------------------------------------+-------------------------------------
Reporter: RyanGlScott | Owner: (none)
Type: bug | Status: new
Priority: normal | Milestone: 8.6.1
Component: Compiler | Version: 8.4.3
Resolution: | Keywords:
| TypeApplications, TypeFamilies,
| CUSKs
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by simonpj):
> Bottom line: any use of visible kind application should be considered to
be an instance of polymorphic recursion.
Yes, and we (presumably) have exactly same at the term level
{{{
reverse (xs :: [a]) = ...(reverse @a ys)....
}}}
This is illegal. When type checking `reverse`'s RHS we have `reverse ::
alpha` in the envt, and you can't type-apply that to anything. If we had
a signature
{{{
reverse :: [b] -> [b]
reverse (xs :: [a]) = ...(reverse @a ys)....
}}}
that's fine, because the signature puts `reverse :: forall b. [b] -> [b]`
into the envt.
This might be a useful example to add to the user-manual documetation for
visible type application.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15592#comment:3>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list