{-# LANGUAGE DataKinds #-}
import Control.Monad.Freer
import Control.Monad.Freer.Reader
import Control.Monad.Freer.State
import Data.Coerce
badness :: Eff '[Reader (Int, Int)] a -> Eff '[State Int] a
badness = coerce
boom :: (Int, Int)
boom = run $ evalState 17 (badness ask)
I believe the fix is to add a role annotation
type role Union nominal nominal
here:
|
-- | Open union is a strong sum (existential with an evidence). |
|
data Union (r :: [Type -> Type]) a where |
|
Union :: {-# UNPACK #-} !Word -> t a -> Union r a |
(I can make a PR if welcome)
{-# LANGUAGE DataKinds #-} import Control.Monad.Freer import Control.Monad.Freer.Reader import Control.Monad.Freer.State import Data.Coerce badness :: Eff '[Reader (Int, Int)] a -> Eff '[State Int] a badness = coerce boom :: (Int, Int) boom = run $ evalState 17 (badness ask)I believe the fix is to add a role annotation
here:
freer-simple/src/Data/OpenUnion/Internal.hs
Lines 39 to 41 in 5304190
(I can make a PR if welcome)