-- SPDX-License-Identifier: MPL-2.0

{- |
Copyright   :  (c) 2024-2025 Sayo contributors
License     :  MPL-2.0 (see the LICENSE file)
Maintainer  :  ymdfield@outlook.jp

Realizes [@unliftio@](https://hackage.haskell.org/package/unliftio) in the form of higher-order effects.
-}
module Control.Monad.Hefty.Unlift (module Control.Monad.Hefty.Unlift, module Data.Effect.Unlift) where

import Control.Monad.Hefty (Eff, Emb)
import Data.Effect.Unlift hiding (runUnliftBase, runUnliftIO)
import Data.Effect.Unlift qualified as G
import UnliftIO (MonadUnliftIO)

runUnliftBase :: (Monad m) => Eff '[UnliftBase m, Emb m] a -> m a
runUnliftBase :: forall (m :: * -> *) a.
Monad m =>
Eff '[UnliftBase m, Emb m] a -> m a
runUnliftBase = Eff Freer '[UnliftBase m, Emb m] a -> m a
forall (b :: * -> *) (ff :: (* -> *) -> * -> *) a
       (c :: (* -> *) -> Constraint).
(c b, Free c ff) =>
Eff ff '[UnliftBase b, Emb b] a -> b a
G.runUnliftBase
{-# INLINE runUnliftBase #-}

runUnliftIO :: (MonadUnliftIO m) => Eff '[UnliftIO, Emb m] a -> m a
runUnliftIO :: forall (m :: * -> *) a.
MonadUnliftIO m =>
Eff '[UnliftIO, Emb m] a -> m a
runUnliftIO = Eff Freer '[UnliftIO, Emb m] a -> m a
forall (m :: * -> *) (c :: (* -> *) -> Constraint)
       (ff :: (* -> *) -> * -> *) a.
(MonadUnliftIO m, Free c ff, c m) =>
Eff ff '[UnliftIO, Emb m] a -> m a
G.runUnliftIO
{-# INLINE runUnliftIO #-}