[GHC] #11754: Error in optCoercion

GHC ghc-devs at haskell.org
Mon Mar 28 18:27:47 UTC 2016


#11754: Error in optCoercion
-------------------------------------+-------------------------------------
        Reporter:  simonpj           |                Owner:  goldfire
            Type:  bug               |               Status:  closed
        Priority:  highest           |            Milestone:  8.0.1
       Component:  Compiler          |              Version:  8.1
      Resolution:  fixed             |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
                                     |  typecheck/should_compile/T11754
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------
Changes (by bgamari):

 * status:  merge => closed
 * resolution:   => fixed


@@ -2,1 +2,1 @@
- {{{
+ {{{#!hs

New description:

 This program fails Lint after a run of the simplifier.
 {{{#!hs
 {-# LANGUAGE TypeOperators, UndecidableSuperClasses, KindSignatures,
 TypeFamilies, FlexibleContexts #-}

 module T11728a where

 import Data.Kind
 import Data.Void

 newtype K a x = K a
 newtype I   x = I x

 data (f + g) x = L (f x) | R (g x)
 data (f × g) x = f x :×: g x

 class Differentiable (D f) => Differentiable f where
   type D (f :: Type -> Type) :: Type -> Type

 instance Differentiable (K a) where
   type D (K a) = K Void

 instance Differentiable I where
   type D I = K ()

 instance (Differentiable f₁, Differentiable f₂) => Differentiable (f₁ +
 f₂) where
   type D (f₁ + f₂) = D f₁ + D f₂

 instance (Differentiable f₁, Differentiable f₂) => Differentiable (f₁ ×
 f₂) where
   type D (f₁ × f₂) = (D f₁ × f₂) + (f₁ × D f₂)
 }}}
 Originally reported in #11728, but it's a totally different problem.

 Richard has nailed it already... patch coming from him.

--

Comment:

 Merged to `ghc-8.0` as 91a8e92606890ca191ca7227b11a95c9c76cb428.

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


More information about the ghc-tickets mailing list