module Chiasma.Interpreter.Pure where

import Chiasma.Data.TmuxError (TmuxError)
import Chiasma.Effect.Codec (Codec)
import Chiasma.Effect.TmuxClient (TmuxClient)
import Chiasma.Interpreter.Codec (interpretCodecPure)
import Chiasma.Interpreter.TmuxClient (interpretTmuxClientNull)

interpretTmuxPure ::
  ( a . command a -> Sem r (Either Text a)) ->
  InterpretersFor [Scoped_ (TmuxClient () ()) !! TmuxError, Codec command () () !! Text] r
interpretTmuxPure :: forall (command :: * -> *) (r :: [Effect]).
(forall a. command a -> Sem r (Either Text a))
-> InterpretersFor
     '[Scoped_ (TmuxClient () ()) !! TmuxError,
       Codec command () () !! Text]
     r
interpretTmuxPure forall a. command a -> Sem r (Either Text a)
run =
  (forall a. command a -> Sem r (Either Text a))
-> InterpreterFor (Codec command () () !! Text) r
forall (command :: * -> *) (r :: [Effect]) decode.
(forall a. command a -> Sem r (Either Text a))
-> InterpreterFor (Codec command () decode !! Text) r
interpretCodecPure command a -> Sem r (Either Text a)
forall a. command a -> Sem r (Either Text a)
run (Sem ((Codec command () () !! Text) : r) a -> Sem r a)
-> (Sem
      ((Scoped_ (TmuxClient () ()) !! TmuxError)
         : (Codec command () () !! Text) : r)
      a
    -> Sem ((Codec command () () !! Text) : r) a)
-> Sem
     ((Scoped_ (TmuxClient () ()) !! TmuxError)
        : (Codec command () () !! Text) : r)
     a
-> Sem r a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Sem
  ((Scoped_ (TmuxClient () ()) !! TmuxError)
     : (Codec command () () !! Text) : r)
  a
-> Sem ((Codec command () () !! Text) : r) a
forall i (r :: [Effect]) a.
Sem ((Scoped_ (TmuxClient i ()) !! TmuxError) : r) a -> Sem r a
interpretTmuxClientNull