Skip to content

Linear or multiplicity polymorphic coerce

Should there exist a

lcoerce :: Coercible a b => a %m -> b

As coerce is primitive, lcoerce cannot be defined "safely". (Although, coerce isn't safe haskell either).

The coerce itself could be generalized, but I'm not sure whether that would break something (even if it's defined explicitly as forall a b m. Coercible a b => a %m -> b, so the possible TypeApplications are still in right order).

Note: linear unsafeCoerce can be written by a user using UnsafeEquality.

Edited by Oleg Grenrus
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information