{-# LANGUAGE RecursiveDo #-}
module Polysemy.Reader.More
(
module Polysemy.Reader
, runReaderFixSem
) where
import Polysemy
import Polysemy.Reader
import Polysemy.Fixpoint
runReaderFixSem :: forall i r a
. Member Fixpoint r
=> Sem r i
-> Sem (Reader i ': r) a
-> Sem r a
runReaderFixSem :: Sem r i -> Sem (Reader i : r) a -> Sem r a
runReaderFixSem Sem r i
m Sem (Reader i : r) a
sem = do
rec
a
a <- i -> Sem (Reader i : r) a -> Sem r a
forall i (r :: [(* -> *) -> * -> *]) a.
i -> Sem (Reader i : r) a -> Sem r a
runReader i
i Sem (Reader i : r) a
sem
i
i <- Sem r i
m
a -> Sem r a
forall (m :: * -> *) a. Monad m => a -> m a
return a
a
{-# INLINE runReaderFixSem #-}