[GHC] #8799: Orientation of given `Coercible` constraints

#8799: Orientation of given `Coercible` constraints -------------------------------------------+------------------------------- Reporter: nomeata | Owner: Type: feature request | Status: new Priority: normal | Milestone: Component: Compiler (Type checker) | Version: 7.6.3 Keywords: | Operating System: Architecture: Unknown/Multiple | Unknown/Multiple Difficulty: Unknown | Type of failure: Blocked By: | None/Unknown Related Tickets: #8555 | Test Case: | Blocking: -------------------------------------------+------------------------------- {{{ Prelude> :m + GHC.Exts Prelude GHC.Exts> let f :: Coercible a b => b -> a ; f = coerce <interactive>:3:40: Could not coerce from ‛b’ to ‛a’ because ‛b’ and ‛a’ are different types. arising from a use of ‛coerce’ from the context (Coercible a b) bound by the type signature for f :: Coercible a b => b -> a at <interactive>:3:10-32 In the expression: coerce In an equation for ‛f’: f = coerce }}} Something better could be done here (but its not clear what exactly, and to what general extend). -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8799 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8799: Orientation of given `Coercible` constraints --------------------------------------------+------------------------------ Reporter: nomeata | Owner: Type: feature request | Status: new Priority: normal | Milestone: Component: Compiler (Type checker) | Version: 7.6.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Test Case: | Difficulty: Unknown Blocking: | Blocked By: | Related Tickets: #8555 --------------------------------------------+------------------------------ Comment (by goldfire): There is similar behavior when trying to test transitivity. I don't have any suggestions of how to fix this without a whole lot of work. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8799#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8799: Orientation of given `Coercible` constraints --------------------------------------------+------------------------------ Reporter: nomeata | Owner: Type: feature request | Status: new Priority: normal | Milestone: Component: Compiler (Type checker) | Version: 7.6.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Test Case: | Difficulty: Unknown Blocking: | Blocked By: | Related Tickets: #8555 --------------------------------------------+------------------------------ Comment (by rwbarton): FWIW this works (with !ScopedTypeVariables): {{{ let f :: forall a b. Coercible a b => b -> a; f = coerce (id :: a -> a) }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8799#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8799: Orientation of given `Coercible` constraints -------------------------------------+------------------------------------- Reporter: nomeata | Owner: Type: feature request | Status: closed Priority: normal | Milestone: Component: Compiler (Type | Version: 7.6.3 checker) | Keywords: Resolution: fixed | Architecture: Operating System: Unknown/Multiple | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #8555 | Differential Revisions: -------------------------------------+------------------------------------- Changes (by nomeata): * cc: goldfire (added) * status: new => closed * resolution: => fixed Comment: Due to Richard’s rewrite of the Coercible parser, this now works. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8799#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8799: Orientation of given `Coercible` constraints
-------------------------------------+-------------------------------------
Reporter: nomeata | Owner:
Type: feature request | Status: closed
Priority: normal | Milestone:
Component: Compiler (Type | Version: 7.6.3
checker) | Keywords:
Resolution: fixed | Architecture:
Operating System: Unknown/Multiple | Unknown/Multiple
Type of failure: None/Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: #8555 | Differential Revisions:
-------------------------------------+-------------------------------------
Comment (by Simon Peyton Jones

#8799: Orientation of given `Coercible` constraints -------------------------------------+------------------------------------- Reporter: nomeata | Owner: Type: feature request | Status: closed Priority: normal | Milestone: Component: Compiler (Type | Version: 7.6.3 checker) | Keywords: Resolution: fixed | Architecture: Operating System: Unknown/Multiple | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | typecheck/should_compile/T8799 Related Tickets: #8555 | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by simonpj): * testcase: => typecheck/should_compile/T8799 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8799#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC