[GHC] #11305: TC Regression

#11305: TC Regression -------------------------------------+------------------------------------- Reporter: hvr | Owner: Type: bug | Status: new Priority: highest | Milestone: 8.0.1 Component: Compiler | Version: 7.11 (Type checker) | Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- TODO: figure out better summary ;-) The following snippet extracted from Edward's `profunctors` package compiles with GHC 7.10.3, but fails to type-check with GHC HEAD: {{{#!hs {-# LANGUAGE RankNTypes #-} {-# LANGUAGE TypeOperators #-} module Data.Profunctor.Strong where import Control.Arrow import Control.Category import Data.Tuple import Prelude hiding (id,(.)) infixr 0 :-> type p :-> q = forall a b. p a b -> q a b class Profunctor p where dimap :: (a -> b) -> (c -> d) -> p b c -> p a d class ProfunctorFunctor t where promap :: Profunctor p => (p :-> q) -> t p :-> t q class ProfunctorFunctor t => ProfunctorMonad t where proreturn :: Profunctor p => p :-> t p projoin :: Profunctor p => t (t p) :-> t p class ProfunctorFunctor t => ProfunctorComonad t where proextract :: Profunctor p => t p :-> p produplicate :: Profunctor p => t p :-> t (t p) class Profunctor p => Strong p where first' :: p a b -> p (a, c) (b, c) first' = dimap swap swap . second' second' :: p a b -> p (c, a) (c, b) second' = dimap swap swap . first' ---------------------------------------------------------------------------- newtype Tambara p a b = Tambara { runTambara :: forall c. p (a, c) (b, c) } instance Profunctor p => Profunctor (Tambara p) where dimap f g (Tambara p) = Tambara $ dimap (first f) (first g) p instance ProfunctorFunctor Tambara where promap f (Tambara p) = Tambara (f p) instance ProfunctorComonad Tambara where proextract (Tambara p) = dimap (\a -> (a,())) fst p produplicate (Tambara p) = Tambara (Tambara $ dimap hither yon p) where hither :: ((a, b), c) -> (a, (b, c)) hither ~(~(x,y),z) = (x,(y,z)) yon :: (a, (b, c)) -> ((a, b), c) yon ~(x,~(y,z)) = ((x,y),z) instance Profunctor p => Strong (Tambara p) where first' = runTambara . produplicate }}} {{{ Strong.hs:57:12: error: • Couldn't match type ‘Tambara p (a, c) (b, c)’ with ‘forall c1. Tambara p (a, c1) (b, c1)’ Expected type: Tambara (Tambara p) a b -> Tambara p (a, c) (b, c) Actual type: Tambara (Tambara p) a b -> forall c. Tambara p (a, c) (b, c) • In the first argument of ‘(.)’, namely ‘runTambara’ In the expression: runTambara . produplicate In an equation for ‘first'’: first' = runTambara . produplicate • Relevant bindings include first' :: Tambara p a b -> Tambara p (a, c) (b, c) (bound at Strong.hs:57:3) }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11305 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11305: TC Regression -------------------------------------+------------------------------------- Reporter: hvr | Owner: goldfire Type: bug | Status: new Priority: highest | Milestone: 8.0.1 Component: Compiler (Type | Version: 7.11 checker) | Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by hvr): * owner: => goldfire Comment: According to `git bisect`, the culprit is 2db18b8135335da2da9918b722699df684097be9 (i.e. visible type applications) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11305#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11305: TC regression due introduced by visible type-application -------------------------------------+------------------------------------- Reporter: hvr | Owner: goldfire Type: bug | Status: new Priority: highest | Milestone: 8.0.1 Component: Compiler (Type | Version: 7.11 checker) | Resolution: | Keywords: regression Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by hvr): * keywords: => regression -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11305#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11305: Type checker regression introduced by visible type-application -------------------------------------+------------------------------------- Reporter: hvr | Owner: goldfire Type: bug | Status: new Priority: highest | Milestone: 8.0.1 Component: Compiler (Type | Version: 7.11 checker) | Resolution: | Keywords: regression Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11305#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11305: Type checker regression introduced by visible type-application -------------------------------------+------------------------------------- Reporter: hvr | Owner: goldfire Type: bug | Status: patch Priority: highest | Milestone: 8.0.1 Component: Compiler (Type | Version: 7.11 checker) | Resolution: | Keywords: regression Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: | typecheck/should_compile/T11305 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D1715 Wiki Page: | -------------------------------------+------------------------------------- Changes (by goldfire): * status: new => patch * testcase: => typecheck/should_compile/T11305 * differential: => Phab:D1715 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11305#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11305: Type checker regression introduced by visible type-application
-------------------------------------+-------------------------------------
Reporter: hvr | Owner: goldfire
Type: bug | Status: patch
Priority: highest | Milestone: 8.0.1
Component: Compiler (Type | Version: 7.11
checker) |
Resolution: | Keywords: regression
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case:
| typecheck/should_compile/T11305
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s): Phab:D1715
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Richard Eisenberg

#11305: Type checker regression introduced by visible type-application -------------------------------------+------------------------------------- Reporter: hvr | Owner: goldfire Type: bug | Status: closed Priority: highest | Milestone: 8.0.1 Component: Compiler (Type | Version: 7.11 checker) | Resolution: fixed | Keywords: regression Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: | typecheck/should_compile/T11305 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D1715 Wiki Page: | -------------------------------------+------------------------------------- Changes (by goldfire): * status: patch => closed * resolution: => fixed Comment: Should be all set now. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11305#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC