[GHC] #14661: Cannot derive (newtype I a b = I (F a -> F b) deriving newtype Category) for type family F

GHC ghc-devs at haskell.org
Thu Jan 11 20:04:30 UTC 2018


#14661: Cannot derive (newtype I a b = I (F a -> F b) deriving newtype Category)
for type family F
-------------------------------------+-------------------------------------
        Reporter:  Iceland_jack      |                Owner:  (none)
            Type:  feature request   |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.4.1-alpha1
      Resolution:                    |             Keywords:
                                     |  DerivingStrategies, deriving,
                                     |  TypeFamilies
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 Iceland_jack):

 Similar example from Conal's [http://conal.net/papers/compiling-to-
 categories/compiling-to-categories.pdf Compiling to Categories], **7.6
 Incremental Computation**

 {{{#!hs
 class HasDelta a where
   type Delta a :: Type

 newtype DelX a b = DelX (Delta a -> Delta b)

 instance Category DelX where
   type Ok DelX = HasDelta
   id = DelX id
   DelX g . DelX f = DelX (g . f)

 instance Cartesian DelX where
   exl = DelX exl
   exr = DelX exr
   DelX f &&& DelX g = DelX (f &&& g)
 }}}

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


More information about the ghc-tickets mailing list