[GHC] #13992: Error message, room for improvement (polykinds)
GHC
ghc-devs at haskell.org
Tue Jul 18 20:11:28 UTC 2017
#13992: Error message, room for improvement (polykinds)
-------------------------------------+-------------------------------------
Reporter: Iceland_jack | Owner: (none)
Type: feature request | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 8.0.1
Resolution: | Keywords: PolyKinds
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Description changed by Iceland_jack:
Old description:
> Something like
>
> {{{#!hs
> -- • No instance for (Show (Compose Proxy Proxy a))
> -- arising from the 'deriving' clause of a data type declaration
> -- Possible fix:
> -- use a standalone 'deriving instance' declaration,
> -- so you can specify the instance context yourself
> -- • When deriving the instance for (Show (FlipProxy a))
>
> {-# Language DerivingStrategies, GeneralizedNewtypeDeriving, PolyKinds,
> KindSignatures #-}
>
> import Data.Functor.Compose
> import Data.Proxy
> import Data.Kind
>
> newtype FlipProxy a = FlipProxy_ (Compose Proxy Proxy a)
> deriving newtype
> Show
> }}}
>
> where the solution is to constraint the kind of `a :: Type`, it would be
> nice if GHC could reference kind variables.
New description:
Something like
{{{#!hs
-- • No instance for (Show (Compose Proxy Proxy a))
-- arising from the 'deriving' clause of a data type declaration
-- Possible fix:
-- use a standalone 'deriving instance' declaration,
-- so you can specify the instance context yourself
-- • When deriving the instance for (Show (FlipProxy a))
{-# Language DerivingStrategies, GeneralizedNewtypeDeriving, PolyKinds,
KindSignatures #-}
import Data.Functor.Compose
import Data.Proxy
import Data.Kind
newtype FlipProxy a = FlipProxy_ (Compose Proxy Proxy a)
deriving newtype
Show
}}}
where the solution is to constrain the kind of `a` to `Type`, it would be
nice if GHC could reference kind variables.
--
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13992#comment:1>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list