module Control.Effect.Fix
(
Fix(..)
, module Control.Monad.Fix
, fixToFinal
, threadFixViaClass
, FixToFinalC
) where
import Control.Monad.Fix
import Control.Effect
import Control.Effect.Primitive
import Control.Effect.Type.Fix
data FixToFinalH
instance (Carrier m, MonadFix m)
=> PrimHandler FixToFinalH Fix m where
effPrimHandler (Fix f) = mfix f
{-# INLINEABLE effPrimHandler #-}
type FixToFinalC = InterpretPrimC FixToFinalH Fix
fixToFinal :: ( Carrier m
, MonadFix m
)
=> FixToFinalC m a
-> m a
fixToFinal = interpretPrimViaHandler
{-# INLINEABLE fixToFinal #-}