[GHC] #12493: Add gcoerceWith to Data.Type.Coercion

#12493: Add gcoerceWith to Data.Type.Coercion -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: Type: feature | Status: new request | Priority: normal | Milestone: 8.2.1 Component: | Version: 8.0.1 libraries/base | 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: -------------------------------------+------------------------------------- Haskell libraries mailing list discussion: https://mail.haskell.org/pipermail/libraries/2016-July/027207.html
In Data.Type.Equality, we have both
{{{#!hs castWith :: (a :~: b) -> a -> b }}}
and
{{{#!hs gcastWith :: (a :~: b) -> (a ~ b => r) -> r }}}
But in `Data.Type.Coercion` we only have
{{{#!hs coerceWith :: Coercion a b -> a -> b }}}
It seems to me that for the sake of consistency, we should add
{{{#!hs gcoerceWith :: Coercion a b -> (Coercible a b => r) -> r gcoerceWith Coercion a = a }}}
David Feuer
I've wanted this too. Patch incoming. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12493 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12493: Add gcoerceWith to Data.Type.Coercion -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: Type: feature request | Status: patch Priority: normal | Milestone: 8.2.1 Component: libraries/base | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D2456 Wiki Page: | -------------------------------------+------------------------------------- Changes (by RyanGlScott): * status: new => patch * differential: => Phab:D2456 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12493#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12493: Add gcoerceWith to Data.Type.Coercion
-------------------------------------+-------------------------------------
Reporter: RyanGlScott | Owner:
Type: feature request | Status: patch
Priority: normal | Milestone: 8.2.1
Component: libraries/base | Version: 8.0.1
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s): Phab:D2456
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Ryan Scott

#12493: Add gcoerceWith to Data.Type.Coercion -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: Type: feature request | Status: closed Priority: normal | Milestone: 8.2.1 Component: libraries/base | Version: 8.0.1 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D2456 Wiki Page: | -------------------------------------+------------------------------------- Changes (by RyanGlScott): * status: patch => closed * resolution: => fixed -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12493#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC