[GHC] #9106: GHC Panic related to functional dependencies - kindFunResult

GHC ghc-devs at haskell.org
Tue May 13 21:44:00 UTC 2014


#9106: GHC Panic related to functional dependencies - kindFunResult
---------------------------------------+---------------------------
        Reporter:  yuriy               |            Owner:
            Type:  bug                 |           Status:  new
        Priority:  normal              |        Milestone:
       Component:  Compiler            |          Version:  7.8.2
      Resolution:                      |         Keywords:
Operating System:  Windows             |     Architecture:  x86
 Type of failure:  Compile-time crash  |       Difficulty:  Unknown
       Test Case:                      |       Blocked By:
        Blocking:                      |  Related Tickets:
---------------------------------------+---------------------------

Comment (by yuriy):

 The same code without {{{GHC.TypeLits}}} works:

 {{{
 {-# LANGUAGE
   MultiParamTypeClasses, DataKinds, FunctionalDependencies, TypeOperators,
   KindSignatures, PolyKinds, FlexibleInstances, FlexibleContexts,
 UndecidableInstances,
   ScopedTypeVariables #-}

 data Proxy (a :: k) = Proxy

 data Nat = Z | P Nat

 class FunctorN n f a fa | n f a -> fa where
   fmapn :: Proxy n -> Proxy f -> (a -> a) -> fa -> fa

 instance FunctorN Z f a a where
   fmapn _ _ a = a

 instance (Functor f, FunctorN n f a fa) => FunctorN (P n) f a (f fa) where
   fmapn _ pf f = fmap (fmapn (Proxy :: Proxy n) pf f)
 }}}

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


More information about the ghc-tickets mailing list