{-# LANGUAGE RoleAnnotations #-}
module Coerce where
import Data.Coerce (coerce)
import Data.Kind (Type)
type role Foo phantom
data Foo a = Foo
foo :: forall (a :: Type) (b :: Type) . Foo a -> Foo b
foo = coerce
accepted by ghc 9.12.1
rejected by mhs 0.15.5.0
*** Exception: error: "./Coerce.hs": line 11, col 7:
Cannot satisfy constraint: (Coercible a b)
fully qualified: (Data.Coerce.Coercible a b)
{-# LANGUAGE RoleAnnotations #-} module Coerce where import Data.Coerce (coerce) import Data.Kind (Type) type role Foo phantom data Foo a = Foo foo :: forall (a :: Type) (b :: Type) . Foo a -> Foo b foo = coerceaccepted by ghc 9.12.1
rejected by mhs 0.15.5.0