Opened 2 years ago

Last modified 12 months ago

#13992 new feature request

Error message, room for improvement (polykinds)

Reported by: Iceland_jack Owned by:
Priority: normal Milestone:
Component: Compiler Version: 8.0.1
Keywords: PolyKinds Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: #14146, #16050 Differential Rev(s):
Wiki Page:

Description (last modified by Iceland_jack)

Something like

--    • 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.

Change History (2)

comment:1 Changed 2 years ago by Iceland_jack

Description: modified (diff)

comment:2 Changed 12 months ago by RyanGlScott

Note: See TracTickets for help on using tickets.