Does a one way version of Coercible
exist? For example if I have
newtype Prime = MkUnsafePrime Int
mkPrime :: Int -> Maybe Prime
Then I want something like instance CoercibleOneWay Prime Int
with coerceOneWay :: CoercibleOneWay a b -> a -> b
. With Coercible
I either get both directions (if the constructor is in scope) or neither direction (if it’s not). Surely we can do better. Has anyone done something like that yet?