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

GHC ghc-devs at haskell.org
Tue Feb 18 17:22:34 UTC 2014


#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


More information about the ghc-tickets mailing list