{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE TupleSections #-}
{-# OPTIONS_GHC -Wno-orphans #-}
module Effect.IO.Passthrough where
import Control.Monad.IO.Class
import Effect
import Effect.IO
instance (MonadIO m) => InterpretEffectStateful x m MonadIOEffect where
interpretEffectStateful :: forall (ops :: [Effect]) x a.
(forall b y. x y -> AST ops b -> m (b, x y))
-> x x -> MonadIOEffect (AST ops) a -> m (a, x x)
interpretEffectStateful forall b y. x y -> AST ops b -> m (b, x y)
_ x x
x (LiftIO IO a
io) = (,x x
x) (a -> (a, x x)) -> m a -> m (a, x x)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> IO a -> m a
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO IO a
io