unifyWithRef :: forall eff a. Eff eff a -> Eff ( ref :: REF | eff ) a
unifyWithRef = unsafeCoerceEff
foo ::
forall eff .
Eff ( console :: CONSOLE | eff ) Unit
-> Eff ( console :: CONSOLE, ref :: REF | eff) Unit
foo param = f
where
f :: Eff (ref :: REF, console :: CONSOLE | eff) Unit
f = do
consoleAndRef
-- param
unifyWithRef param
pure unit
The following code works, but only with unifyWithRef (unsafeCoerceEff). If i just use param directly it fails to unify