module Ribosome.Host.Interpret where

type (|>) :: [k] -> k -> [k]
type (a :: [k]) |> (b :: k) =
  a ++ '[b]

infixl 6 |>

type HigherOrder r r' =
  Members r' (r ++ r')

with :: Sem r a -> (a -> InterpreterFor eff r) -> InterpreterFor eff r
with :: forall (r :: EffectRow) a (eff :: Effect).
Sem r a -> (a -> InterpreterFor eff r) -> InterpreterFor eff r
with Sem r a
acquire a -> InterpreterFor eff r
f Sem (eff : r) a
sem = do
  a
a <- Sem r a
acquire
  a -> InterpreterFor eff r
f a
a Sem (eff : r) a
sem
{-# inline with #-}