Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
GHC
GHC
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 4,274
    • Issues 4,274
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 412
    • Merge Requests 412
  • Requirements
    • Requirements
    • List
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Security & Compliance
    • Security & Compliance
    • Dependency List
    • License Compliance
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI / CD
    • Code Review
    • Insights
    • Issue
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Glasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #11754

Closed
Open
Opened Mar 25, 2016 by Simon Peyton Jones@simonpjDeveloper

Error in optCoercion

This program fails Lint after a run of the simplifier.

{-# 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 (closed), but it's a totally different problem.

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

Edited Mar 10, 2019 by Ben Gamari
Assignee
Assign to
8.0.1
Milestone
8.0.1 (Past due)
Assign milestone
Time tracking
None
Due date
None
Reference: ghc/ghc#11754