[GHC] #15852: Bad axiom produced for polykinded data family
GHC
ghc-devs at haskell.org
Sat Nov 10 20:45:33 UTC 2018
#15852: Bad axiom produced for polykinded data family
-------------------------------------+-------------------------------------
Reporter: goldfire | Owner: (none)
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 8.7
Resolution: | Keywords: TypeFamilies,
| TypeInType
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 RyanGlScott):
`IfaceTyConInfo` or `IfaceTyConSort` might be possible candidates for
storing this information. Currently, these are defined as:
{{{#!hs
data IfaceTyConInfo -- Used to guide pretty-printing
-- and to disambiguate D from 'D (they share a name)
= IfaceTyConInfo { ifaceTyConIsPromoted :: IsPromoted
, ifaceTyConSort :: IfaceTyConSort }
-- | The various types of TyCons which have special, built-in syntax.
data IfaceTyConSort = IfaceNormalTyCon -- ^ a regular tycon
| IfaceTupleTyCon !Arity !TupleSort
-- ^ e.g. @(a, b, c)@ or @(#a, b, c#)@.
| IfaceSumTyCon !Arity
-- ^ e.g. @(a | b | c)@
| IfaceEqualityTyCon
-- ^ A heterogeneous equality TyCon
}}}
(The Haddocks for `IfaceTyConSort` are misleading, since //every//
`IfaceTyCon` has one, not just those with special, built-in syntax.
Regardless of how we fix this bug, we should change that documentation to
reflect reality.)
My vote would be to extend one of these data types with an extra field of
type `IfaceTyConParent`, which would be sufficient to tell if a `TyCon`
came from a data family instance or not. Then it would just be a matter of
plumbing this information to `pprAxBranch` from its call sites.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15852#comment:3>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list