Proposal: Add gcoerceWith to Data.Type.Coercion

David Feuer david.feuer at gmail.com
Thu Jul 21 23:18:59 UTC 2016


In Data.Type.Equality, we have both

castWith :: (a :~: b) -> a -> b

and

gcastWith :: (a :~: b) -> (a ~ b => r) -> r


But in Data.Type.Coercion we only have


coerceWith :: Coercion a b -> a -> b


It seems to me that for the sake of consistency, we should add


gcoerceWith :: Coercion a b -> (Coercible a b => r) -> r
gcoerceWith Coercion a = a

David Feuer


More information about the Libraries mailing list