[GHC] #14490: TTG Snags

GHC ghc-devs at haskell.org
Mon Nov 27 14:22:06 UTC 2017


#14490: TTG Snags
-------------------------------------+-------------------------------------
        Reporter:  alanz             |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.3
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:  #14482            |  Differential Rev(s):
       Wiki Page:                    |
  ImplementingTreesThatGrow          |
-------------------------------------+-------------------------------------

Comment (by simonpj):

 I was thinking abou this
 {{{
 {-# LANGUAGE TypeFamilies, GADTs, FlexibleInstances, StandaloneDeriving,
 DeriveDataTypeable #-}

 module Foo where

 import Data.Data
 import Data.Typeable

 data Ext x = MkExt x

 data T a where
   MkT :: XT a -> a -> T a

 data GhcPass p

 type family XT a
 type instance XT (GhcPass p) = Ext ()

 instance Typeable x => Data (Ext x) where
   gmapM f v = return v

 deriving instance Typeable p => Data (T (GhcPass p))

 instance Typeable p => Data (GhcPass p)
 }}}
 This compiles fine.

 I regret the need for `Data (GhcPass p)`, becuase `(GhcPass p)` is ony a
 type index: there are no data values of this type.  It's somehow needed in
 the defn of `gfoldl`, but I can't see why.

-- 
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/14490#comment:40>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list