[GHC] #14694: Can't coerce given assumptions

GHC ghc-devs at haskell.org
Sun Jan 21 01:14:35 UTC 2018


#14694: Can't coerce given assumptions
-------------------------------------+-------------------------------------
           Reporter:  Iceland_jack   |             Owner:  (none)
               Type:  bug            |            Status:  new
           Priority:  normal         |         Milestone:
          Component:  Compiler       |           Version:  8.2.2
           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:
-------------------------------------+-------------------------------------
 {{{
 $ ghci -ignore-dot-ghci
 GHCi, version 8.5.20180105: http://www.haskell.org/ghc/  :? for help
 Prelude> newtype WF f a = WF (f a)
 Prelude> import Data.Coerce
 Prelude Data.Coerce> :set -XFlexibleContexts
 Prelude Data.Coerce> :t coerce :: Coercible (cat a b) (a -> f b) => cat a
 b -> (a -> WF f b)

 <interactive>:1:1: error:
     • Couldn't match representation of type ‘cat1 a1 b1’
                                with that of ‘a1 -> WF f1 b1’
         arising from a use of ‘coerce’
     • In the expression:
           coerce ::
             Coercible (cat a b) (a -> f b) => cat a b -> (a -> WF f b)
 }}}

 I'm not sure if I've filed this before or if it's even a bug.

 But we know that `Coercible (a -> f b) (a -> WF f b)` so why doesn't this
 work?

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


More information about the ghc-tickets mailing list