module Ribosome.Host.Embed where
import Conc (ChanConsumer, ChanEvents, interpretEventsChan)
import Polysemy.Process (Process)
import qualified Polysemy.Process.Effect.Process as Process
import Ribosome.Host.Data.BootError (BootError)
import Ribosome.Host.Data.Report (Report)
import Ribosome.Host.Data.RpcHandler (RpcHandler)
import Ribosome.Host.Data.RpcMessage (RpcMessage)
import Ribosome.Host.Effect.Handlers (Handlers)
import Ribosome.Host.Effect.Rpc (Rpc)
import Ribosome.Host.IOStack (BasicStack)
import Ribosome.Host.Interpreter.Handlers (interpretHandlers, interpretHandlersNull)
import Ribosome.Host.Interpreter.Host (testHost, withHost)
import Ribosome.Host.Interpreter.Process.Embed (interpretProcessCerealNvimEmbed)
import Ribosome.Host.Interpreter.UserError (interpretUserErrorInfo)
import Ribosome.Host.Run (RpcDeps, RpcStack, interpretRpcStack)
publishRequests ::
∀ res i o r a .
Members [Process i o, Events res i] r =>
Sem r a ->
Sem r a
publishRequests :: forall res i o (r :: EffectRow) a.
Members '[Process i o, Events res i] r =>
Sem r a -> Sem r a
publishRequests =
forall (e :: (* -> *) -> * -> *) (r :: EffectRow) a.
(Member e r, FirstOrder e "intercept") =>
(forall x (rInitial :: EffectRow). e (Sem rInitial) x -> Sem r x)
-> Sem r a -> Sem r a
intercept @(Process i o) \case
Process.Send i
msg -> do
i -> Sem r ()
forall e resource (r :: EffectRow).
Member (Events resource e) r =>
e -> Sem r ()
publish i
msg
i -> Sem r ()
forall i o (r :: EffectRow).
Member (Process i o) r =>
i -> Sem r ()
Process.send i
msg
Process i o (Sem rInitial) x
e ->
forall (e :: (* -> *) -> * -> *) (r :: EffectRow) a.
Member e r =>
e (Sem r) a -> Sem r a
send @(Process i o) (Process i o (Sem rInitial) x -> Process i o (Sem r) x
coerce Process i o (Sem rInitial) x
e)
type =
[
ChanEvents RpcMessage,
ChanConsumer RpcMessage
]
type HostEmbedStack =
RpcStack ++ EmbedExtra ++ RpcDeps
interpretEmbedExtra ::
Members [Process RpcMessage o, Error BootError, Log, Resource, Race, Async, Embed IO] r =>
InterpretersFor EmbedExtra r
=
forall e (r :: EffectRow).
Members '[Resource, Race, Async, Embed IO] r =>
InterpretersFor '[Events (OutChan e) e, ChanConsumer e] r
interpretEventsChan @RpcMessage (Sem
(Events (OutChan RpcMessage) RpcMessage
: PScoped () (EventChan RpcMessage) (Consume RpcMessage) : r)
a
-> Sem r a)
-> (Sem
(Events (OutChan RpcMessage) RpcMessage
: PScoped () (EventChan RpcMessage) (Consume RpcMessage) : r)
a
-> Sem
(Events (OutChan RpcMessage) RpcMessage
: PScoped () (EventChan RpcMessage) (Consume RpcMessage) : r)
a)
-> Sem
(Events (OutChan RpcMessage) RpcMessage
: PScoped () (EventChan RpcMessage) (Consume RpcMessage) : r)
a
-> Sem r a
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
Sem
(Events (OutChan RpcMessage) RpcMessage
: PScoped () (EventChan RpcMessage) (Consume RpcMessage) : r)
a
-> Sem
(Events (OutChan RpcMessage) RpcMessage
: PScoped () (EventChan RpcMessage) (Consume RpcMessage) : r)
a
forall res i o (r :: EffectRow) a.
Members '[Process i o, Events res i] r =>
Sem r a -> Sem r a
publishRequests
interpretRpcDeps ::
Members [Error BootError, Log, Resource, Race, Async, Embed IO] r =>
InterpretersFor RpcDeps r
interpretRpcDeps :: forall (r :: EffectRow).
Members
'[Error BootError, Log, Resource, Race, Async, Embed IO] r =>
InterpretersFor RpcDeps r
interpretRpcDeps =
Sem (UserError : r) a -> Sem r a
forall (r :: EffectRow). InterpreterFor UserError r
interpretUserErrorInfo (Sem (UserError : r) a -> Sem r a)
-> (Sem
(Process RpcMessage (Either Text RpcMessage) : UserError : r) a
-> Sem (UserError : r) a)
-> Sem
(Process RpcMessage (Either Text RpcMessage) : UserError : r) a
-> Sem r a
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
Maybe ProcessOptions
-> Maybe (ProcessConfig () () ())
-> InterpreterFor
(Process RpcMessage (Either Text RpcMessage)) (UserError : r)
forall a (r :: EffectRow).
(Serialize a,
Members
'[Error BootError, Log, Resource, Race, Async, Embed IO] r) =>
Maybe ProcessOptions
-> Maybe (ProcessConfig () () ())
-> InterpreterFor (Process a (Either Text a)) r
interpretProcessCerealNvimEmbed Maybe ProcessOptions
forall a. Maybe a
Nothing Maybe (ProcessConfig () () ())
forall a. Maybe a
Nothing
interpretHostEmbed ::
Members BasicStack r =>
InterpretersFor HostEmbedStack r
interpretHostEmbed :: forall (r :: EffectRow).
Members BasicStack r =>
InterpretersFor HostEmbedStack r
interpretHostEmbed =
Sem (Process RpcMessage (Either Text RpcMessage) : UserError : r) a
-> Sem r a
forall (r :: EffectRow).
Members
'[Error BootError, Log, Resource, Race, Async, Embed IO] r =>
InterpretersFor RpcDeps r
interpretRpcDeps (Sem
(Process RpcMessage (Either Text RpcMessage) : UserError : r) a
-> Sem r a)
-> (Sem
(Log
: DataLog LogReport : Resumable RpcError Rpc
: Resumable RpcError (Responses RequestId Response)
: Events (OutChan Event) Event
: PScoped () (EventChan Event) (Consume Event) : Reports
: Events (OutChan RpcMessage) RpcMessage
: PScoped () (EventChan RpcMessage) (Consume RpcMessage)
: Process RpcMessage (Either Text RpcMessage) : UserError : r)
a
-> Sem
(Process RpcMessage (Either Text RpcMessage) : UserError : r) a)
-> Sem
(Log
: DataLog LogReport : Resumable RpcError Rpc
: Resumable RpcError (Responses RequestId Response)
: Events (OutChan Event) Event
: PScoped () (EventChan Event) (Consume Event) : Reports
: Events (OutChan RpcMessage) RpcMessage
: PScoped () (EventChan RpcMessage) (Consume RpcMessage)
: Process RpcMessage (Either Text RpcMessage) : UserError : r)
a
-> Sem r a
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
Sem
(Events (OutChan RpcMessage) RpcMessage
: PScoped () (EventChan RpcMessage) (Consume RpcMessage)
: Process RpcMessage (Either Text RpcMessage) : UserError : r)
a
-> Sem
(Process RpcMessage (Either Text RpcMessage) : UserError : r) a
forall o (r :: EffectRow).
Members
'[Process RpcMessage o, Error BootError, Log, Resource, Race,
Async, Embed IO]
r =>
InterpretersFor EmbedExtra r
interpretEmbedExtra (Sem
(Events (OutChan RpcMessage) RpcMessage
: PScoped () (EventChan RpcMessage) (Consume RpcMessage)
: Process RpcMessage (Either Text RpcMessage) : UserError : r)
a
-> Sem
(Process RpcMessage (Either Text RpcMessage) : UserError : r) a)
-> (Sem
(Log
: DataLog LogReport : Resumable RpcError Rpc
: Resumable RpcError (Responses RequestId Response)
: Events (OutChan Event) Event
: PScoped () (EventChan Event) (Consume Event) : Reports
: Events (OutChan RpcMessage) RpcMessage
: PScoped () (EventChan RpcMessage) (Consume RpcMessage)
: Process RpcMessage (Either Text RpcMessage) : UserError : r)
a
-> Sem
(Events (OutChan RpcMessage) RpcMessage
: PScoped () (EventChan RpcMessage) (Consume RpcMessage)
: Process RpcMessage (Either Text RpcMessage) : UserError : r)
a)
-> Sem
(Log
: DataLog LogReport : Resumable RpcError Rpc
: Resumable RpcError (Responses RequestId Response)
: Events (OutChan Event) Event
: PScoped () (EventChan Event) (Consume Event) : Reports
: Events (OutChan RpcMessage) RpcMessage
: PScoped () (EventChan RpcMessage) (Consume RpcMessage)
: Process RpcMessage (Either Text RpcMessage) : UserError : r)
a
-> Sem
(Process RpcMessage (Either Text RpcMessage) : UserError : r) a
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
Sem
(Log
: DataLog LogReport : Resumable RpcError Rpc
: Resumable RpcError (Responses RequestId Response)
: Events (OutChan Event) Event
: PScoped () (EventChan Event) (Consume Event) : Reports
: Events (OutChan RpcMessage) RpcMessage
: PScoped () (EventChan RpcMessage) (Consume RpcMessage)
: Process RpcMessage (Either Text RpcMessage) : UserError : r)
a
-> Sem
(Events (OutChan RpcMessage) RpcMessage
: PScoped () (EventChan RpcMessage) (Consume RpcMessage)
: Process RpcMessage (Either Text RpcMessage) : UserError : r)
a
forall (r :: EffectRow).
(Members IOStack r, Members RpcDeps r,
Members '[Log, Reader LogConfig] r) =>
InterpretersFor RpcStack r
interpretRpcStack
withHostEmbed ::
Members BasicStack r =>
InterpreterFor (Handlers !! Report) (HostEmbedStack ++ r) ->
InterpretersFor HostEmbedStack r
withHostEmbed :: forall (r :: EffectRow).
Members BasicStack r =>
InterpreterFor (Handlers !! Report) (HostEmbedStack ++ r)
-> InterpretersFor HostEmbedStack r
withHostEmbed InterpreterFor (Handlers !! Report) (HostEmbedStack ++ r)
handlers =
Sem
(Log
: DataLog LogReport : Resumable RpcError Rpc
: Resumable RpcError (Responses RequestId Response)
: Events (OutChan Event) Event
: PScoped () (EventChan Event) (Consume Event) : Reports
: Events (OutChan RpcMessage) RpcMessage
: PScoped () (EventChan RpcMessage) (Consume RpcMessage)
: Process RpcMessage (Either Text RpcMessage) : UserError : r)
a
-> Sem r a
forall (r :: EffectRow).
Members BasicStack r =>
InterpretersFor HostEmbedStack r
interpretHostEmbed (Sem
(Log
: DataLog LogReport : Resumable RpcError Rpc
: Resumable RpcError (Responses RequestId Response)
: Events (OutChan Event) Event
: PScoped () (EventChan Event) (Consume Event) : Reports
: Events (OutChan RpcMessage) RpcMessage
: PScoped () (EventChan RpcMessage) (Consume RpcMessage)
: Process RpcMessage (Either Text RpcMessage) : UserError : r)
a
-> Sem r a)
-> (Sem
(Log
: DataLog LogReport : Resumable RpcError Rpc
: Resumable RpcError (Responses RequestId Response)
: Events (OutChan Event) Event
: PScoped () (EventChan Event) (Consume Event) : Reports
: Events (OutChan RpcMessage) RpcMessage
: PScoped () (EventChan RpcMessage) (Consume RpcMessage)
: Process RpcMessage (Either Text RpcMessage) : UserError : r)
a
-> Sem
(Log
: DataLog LogReport : Resumable RpcError Rpc
: Resumable RpcError (Responses RequestId Response)
: Events (OutChan Event) Event
: PScoped () (EventChan Event) (Consume Event) : Reports
: Events (OutChan RpcMessage) RpcMessage
: PScoped () (EventChan RpcMessage) (Consume RpcMessage)
: Process RpcMessage (Either Text RpcMessage) : UserError : r)
a)
-> Sem
(Log
: DataLog LogReport : Resumable RpcError Rpc
: Resumable RpcError (Responses RequestId Response)
: Events (OutChan Event) Event
: PScoped () (EventChan Event) (Consume Event) : Reports
: Events (OutChan RpcMessage) RpcMessage
: PScoped () (EventChan RpcMessage) (Consume RpcMessage)
: Process RpcMessage (Either Text RpcMessage) : UserError : r)
a
-> Sem r a
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
Sem
((Handlers !! Report)
: Log : DataLog LogReport : Resumable RpcError Rpc
: Resumable RpcError (Responses RequestId Response)
: Events (OutChan Event) Event
: PScoped () (EventChan Event) (Consume Event) : Reports
: Events (OutChan RpcMessage) RpcMessage
: PScoped () (EventChan RpcMessage) (Consume RpcMessage)
: Process RpcMessage (Either Text RpcMessage) : UserError : r)
a
-> Sem
(Log
: DataLog LogReport : Resumable RpcError Rpc
: Resumable RpcError (Responses RequestId Response)
: Events (OutChan Event) Event
: PScoped () (EventChan Event) (Consume Event) : Reports
: Events (OutChan RpcMessage) RpcMessage
: PScoped () (EventChan RpcMessage) (Consume RpcMessage)
: Process RpcMessage (Either Text RpcMessage) : UserError : r)
a
InterpreterFor (Handlers !! Report) (HostEmbedStack ++ r)
handlers (Sem
((Handlers !! Report)
: Log : DataLog LogReport : Resumable RpcError Rpc
: Resumable RpcError (Responses RequestId Response)
: Events (OutChan Event) Event
: PScoped () (EventChan Event) (Consume Event) : Reports
: Events (OutChan RpcMessage) RpcMessage
: PScoped () (EventChan RpcMessage) (Consume RpcMessage)
: Process RpcMessage (Either Text RpcMessage) : UserError : r)
a
-> Sem
(Log
: DataLog LogReport : Resumable RpcError Rpc
: Resumable RpcError (Responses RequestId Response)
: Events (OutChan Event) Event
: PScoped () (EventChan Event) (Consume Event) : Reports
: Events (OutChan RpcMessage) RpcMessage
: PScoped () (EventChan RpcMessage) (Consume RpcMessage)
: Process RpcMessage (Either Text RpcMessage) : UserError : r)
a)
-> (Sem
(Log
: DataLog LogReport : Resumable RpcError Rpc
: Resumable RpcError (Responses RequestId Response)
: Events (OutChan Event) Event
: PScoped () (EventChan Event) (Consume Event) : Reports
: Events (OutChan RpcMessage) RpcMessage
: PScoped () (EventChan RpcMessage) (Consume RpcMessage)
: Process RpcMessage (Either Text RpcMessage) : UserError : r)
a
-> Sem
((Handlers !! Report)
: Log : DataLog LogReport : Resumable RpcError Rpc
: Resumable RpcError (Responses RequestId Response)
: Events (OutChan Event) Event
: PScoped () (EventChan Event) (Consume Event) : Reports
: Events (OutChan RpcMessage) RpcMessage
: PScoped () (EventChan RpcMessage) (Consume RpcMessage)
: Process RpcMessage (Either Text RpcMessage) : UserError : r)
a)
-> Sem
(Log
: DataLog LogReport : Resumable RpcError Rpc
: Resumable RpcError (Responses RequestId Response)
: Events (OutChan Event) Event
: PScoped () (EventChan Event) (Consume Event) : Reports
: Events (OutChan RpcMessage) RpcMessage
: PScoped () (EventChan RpcMessage) (Consume RpcMessage)
: Process RpcMessage (Either Text RpcMessage) : UserError : r)
a
-> Sem
(Log
: DataLog LogReport : Resumable RpcError Rpc
: Resumable RpcError (Responses RequestId Response)
: Events (OutChan Event) Event
: PScoped () (EventChan Event) (Consume Event) : Reports
: Events (OutChan RpcMessage) RpcMessage
: PScoped () (EventChan RpcMessage) (Consume RpcMessage)
: Process RpcMessage (Either Text RpcMessage) : UserError : r)
a
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
Sem
(Host
: (Handlers !! Report) : Log : DataLog LogReport
: Resumable RpcError Rpc
: Resumable RpcError (Responses RequestId Response)
: Events (OutChan Event) Event
: PScoped () (EventChan Event) (Consume Event) : Reports
: Events (OutChan RpcMessage) RpcMessage
: PScoped () (EventChan RpcMessage) (Consume RpcMessage)
: Process RpcMessage (Either Text RpcMessage) : UserError : r)
a
-> Sem
((Handlers !! Report)
: Log : DataLog LogReport : Resumable RpcError Rpc
: Resumable RpcError (Responses RequestId Response)
: Events (OutChan Event) Event
: PScoped () (EventChan Event) (Consume Event) : Reports
: Events (OutChan RpcMessage) RpcMessage
: PScoped () (EventChan RpcMessage) (Consume RpcMessage)
: Process RpcMessage (Either Text RpcMessage) : UserError : r)
a
forall er (r :: EffectRow).
Members (HostDeps er) r =>
InterpreterFor Host r
withHost (Sem
(Host
: (Handlers !! Report) : Log : DataLog LogReport
: Resumable RpcError Rpc
: Resumable RpcError (Responses RequestId Response)
: Events (OutChan Event) Event
: PScoped () (EventChan Event) (Consume Event) : Reports
: Events (OutChan RpcMessage) RpcMessage
: PScoped () (EventChan RpcMessage) (Consume RpcMessage)
: Process RpcMessage (Either Text RpcMessage) : UserError : r)
a
-> Sem
((Handlers !! Report)
: Log : DataLog LogReport : Resumable RpcError Rpc
: Resumable RpcError (Responses RequestId Response)
: Events (OutChan Event) Event
: PScoped () (EventChan Event) (Consume Event) : Reports
: Events (OutChan RpcMessage) RpcMessage
: PScoped () (EventChan RpcMessage) (Consume RpcMessage)
: Process RpcMessage (Either Text RpcMessage) : UserError : r)
a)
-> (Sem
(Log
: DataLog LogReport : Resumable RpcError Rpc
: Resumable RpcError (Responses RequestId Response)
: Events (OutChan Event) Event
: PScoped () (EventChan Event) (Consume Event) : Reports
: Events (OutChan RpcMessage) RpcMessage
: PScoped () (EventChan RpcMessage) (Consume RpcMessage)
: Process RpcMessage (Either Text RpcMessage) : UserError : r)
a
-> Sem
(Host
: (Handlers !! Report) : Log : DataLog LogReport
: Resumable RpcError Rpc
: Resumable RpcError (Responses RequestId Response)
: Events (OutChan Event) Event
: PScoped () (EventChan Event) (Consume Event) : Reports
: Events (OutChan RpcMessage) RpcMessage
: PScoped () (EventChan RpcMessage) (Consume RpcMessage)
: Process RpcMessage (Either Text RpcMessage) : UserError : r)
a)
-> Sem
(Log
: DataLog LogReport : Resumable RpcError Rpc
: Resumable RpcError (Responses RequestId Response)
: Events (OutChan Event) Event
: PScoped () (EventChan Event) (Consume Event) : Reports
: Events (OutChan RpcMessage) RpcMessage
: PScoped () (EventChan RpcMessage) (Consume RpcMessage)
: Process RpcMessage (Either Text RpcMessage) : UserError : r)
a
-> Sem
((Handlers !! Report)
: Log : DataLog LogReport : Resumable RpcError Rpc
: Resumable RpcError (Responses RequestId Response)
: Events (OutChan Event) Event
: PScoped () (EventChan Event) (Consume Event) : Reports
: Events (OutChan RpcMessage) RpcMessage
: PScoped () (EventChan RpcMessage) (Consume RpcMessage)
: Process RpcMessage (Either Text RpcMessage) : UserError : r)
a
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
forall (index :: Nat) (inserted :: EffectRow) (head :: EffectRow)
(oldTail :: EffectRow) (tail :: EffectRow) (old :: EffectRow)
(full :: EffectRow) a.
(ListOfLength index head, WhenStuck index InsertAtUnprovidedIndex,
old ~ Append head oldTail, tail ~ Append inserted oldTail,
full ~ Append head tail,
InsertAtIndex index head tail oldTail full inserted) =>
Sem old a -> Sem full a
insertAt @0
testHostEmbed ::
Members BasicStack r =>
InterpreterFor (Handlers !! Report) (HostEmbedStack ++ r) ->
InterpretersFor (Rpc : HostEmbedStack) r
testHostEmbed :: forall (r :: EffectRow).
Members BasicStack r =>
InterpreterFor (Handlers !! Report) (HostEmbedStack ++ r)
-> InterpretersFor (Rpc : HostEmbedStack) r
testHostEmbed InterpreterFor (Handlers !! Report) (HostEmbedStack ++ r)
handlers =
Sem
(Log
: DataLog LogReport : Resumable RpcError Rpc
: Resumable RpcError (Responses RequestId Response)
: Events (OutChan Event) Event
: PScoped () (EventChan Event) (Consume Event) : Reports
: Events (OutChan RpcMessage) RpcMessage
: PScoped () (EventChan RpcMessage) (Consume RpcMessage)
: Process RpcMessage (Either Text RpcMessage) : UserError : r)
a
-> Sem r a
forall (r :: EffectRow).
Members BasicStack r =>
InterpretersFor HostEmbedStack r
interpretHostEmbed (Sem
(Log
: DataLog LogReport : Resumable RpcError Rpc
: Resumable RpcError (Responses RequestId Response)
: Events (OutChan Event) Event
: PScoped () (EventChan Event) (Consume Event) : Reports
: Events (OutChan RpcMessage) RpcMessage
: PScoped () (EventChan RpcMessage) (Consume RpcMessage)
: Process RpcMessage (Either Text RpcMessage) : UserError : r)
a
-> Sem r a)
-> (Sem
(Rpc
: Log : DataLog LogReport : Resumable RpcError Rpc
: Resumable RpcError (Responses RequestId Response)
: Events (OutChan Event) Event
: PScoped () (EventChan Event) (Consume Event) : Reports
: Events (OutChan RpcMessage) RpcMessage
: PScoped () (EventChan RpcMessage) (Consume RpcMessage)
: Process RpcMessage (Either Text RpcMessage) : UserError : r)
a
-> Sem
(Log
: DataLog LogReport : Resumable RpcError Rpc
: Resumable RpcError (Responses RequestId Response)
: Events (OutChan Event) Event
: PScoped () (EventChan Event) (Consume Event) : Reports
: Events (OutChan RpcMessage) RpcMessage
: PScoped () (EventChan RpcMessage) (Consume RpcMessage)
: Process RpcMessage (Either Text RpcMessage) : UserError : r)
a)
-> Sem
(Rpc
: Log : DataLog LogReport : Resumable RpcError Rpc
: Resumable RpcError (Responses RequestId Response)
: Events (OutChan Event) Event
: PScoped () (EventChan Event) (Consume Event) : Reports
: Events (OutChan RpcMessage) RpcMessage
: PScoped () (EventChan RpcMessage) (Consume RpcMessage)
: Process RpcMessage (Either Text RpcMessage) : UserError : r)
a
-> Sem r a
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
Sem
((Handlers !! Report)
: Log : DataLog LogReport : Resumable RpcError Rpc
: Resumable RpcError (Responses RequestId Response)
: Events (OutChan Event) Event
: PScoped () (EventChan Event) (Consume Event) : Reports
: Events (OutChan RpcMessage) RpcMessage
: PScoped () (EventChan RpcMessage) (Consume RpcMessage)
: Process RpcMessage (Either Text RpcMessage) : UserError : r)
a
-> Sem
(Log
: DataLog LogReport : Resumable RpcError Rpc
: Resumable RpcError (Responses RequestId Response)
: Events (OutChan Event) Event
: PScoped () (EventChan Event) (Consume Event) : Reports
: Events (OutChan RpcMessage) RpcMessage
: PScoped () (EventChan RpcMessage) (Consume RpcMessage)
: Process RpcMessage (Either Text RpcMessage) : UserError : r)
a
InterpreterFor (Handlers !! Report) (HostEmbedStack ++ r)
handlers (Sem
((Handlers !! Report)
: Log : DataLog LogReport : Resumable RpcError Rpc
: Resumable RpcError (Responses RequestId Response)
: Events (OutChan Event) Event
: PScoped () (EventChan Event) (Consume Event) : Reports
: Events (OutChan RpcMessage) RpcMessage
: PScoped () (EventChan RpcMessage) (Consume RpcMessage)
: Process RpcMessage (Either Text RpcMessage) : UserError : r)
a
-> Sem
(Log
: DataLog LogReport : Resumable RpcError Rpc
: Resumable RpcError (Responses RequestId Response)
: Events (OutChan Event) Event
: PScoped () (EventChan Event) (Consume Event) : Reports
: Events (OutChan RpcMessage) RpcMessage
: PScoped () (EventChan RpcMessage) (Consume RpcMessage)
: Process RpcMessage (Either Text RpcMessage) : UserError : r)
a)
-> (Sem
(Rpc
: Log : DataLog LogReport : Resumable RpcError Rpc
: Resumable RpcError (Responses RequestId Response)
: Events (OutChan Event) Event
: PScoped () (EventChan Event) (Consume Event) : Reports
: Events (OutChan RpcMessage) RpcMessage
: PScoped () (EventChan RpcMessage) (Consume RpcMessage)
: Process RpcMessage (Either Text RpcMessage) : UserError : r)
a
-> Sem
((Handlers !! Report)
: Log : DataLog LogReport : Resumable RpcError Rpc
: Resumable RpcError (Responses RequestId Response)
: Events (OutChan Event) Event
: PScoped () (EventChan Event) (Consume Event) : Reports
: Events (OutChan RpcMessage) RpcMessage
: PScoped () (EventChan RpcMessage) (Consume RpcMessage)
: Process RpcMessage (Either Text RpcMessage) : UserError : r)
a)
-> Sem
(Rpc
: Log : DataLog LogReport : Resumable RpcError Rpc
: Resumable RpcError (Responses RequestId Response)
: Events (OutChan Event) Event
: PScoped () (EventChan Event) (Consume Event) : Reports
: Events (OutChan RpcMessage) RpcMessage
: PScoped () (EventChan RpcMessage) (Consume RpcMessage)
: Process RpcMessage (Either Text RpcMessage) : UserError : r)
a
-> Sem
(Log
: DataLog LogReport : Resumable RpcError Rpc
: Resumable RpcError (Responses RequestId Response)
: Events (OutChan Event) Event
: PScoped () (EventChan Event) (Consume Event) : Reports
: Events (OutChan RpcMessage) RpcMessage
: PScoped () (EventChan RpcMessage) (Consume RpcMessage)
: Process RpcMessage (Either Text RpcMessage) : UserError : r)
a
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
Sem
(Rpc
: Host : (Handlers !! Report) : Log : DataLog LogReport
: Resumable RpcError Rpc
: Resumable RpcError (Responses RequestId Response)
: Events (OutChan Event) Event
: PScoped () (EventChan Event) (Consume Event) : Reports
: Events (OutChan RpcMessage) RpcMessage
: PScoped () (EventChan RpcMessage) (Consume RpcMessage)
: Process RpcMessage (Either Text RpcMessage) : UserError : r)
a
-> Sem
((Handlers !! Report)
: Log : DataLog LogReport : Resumable RpcError Rpc
: Resumable RpcError (Responses RequestId Response)
: Events (OutChan Event) Event
: PScoped () (EventChan Event) (Consume Event) : Reports
: Events (OutChan RpcMessage) RpcMessage
: PScoped () (EventChan RpcMessage) (Consume RpcMessage)
: Process RpcMessage (Either Text RpcMessage) : UserError : r)
a
forall er (r :: EffectRow).
Members (HostDeps er) r =>
InterpretersFor '[Rpc, Host] r
testHost (Sem
(Rpc
: Host : (Handlers !! Report) : Log : DataLog LogReport
: Resumable RpcError Rpc
: Resumable RpcError (Responses RequestId Response)
: Events (OutChan Event) Event
: PScoped () (EventChan Event) (Consume Event) : Reports
: Events (OutChan RpcMessage) RpcMessage
: PScoped () (EventChan RpcMessage) (Consume RpcMessage)
: Process RpcMessage (Either Text RpcMessage) : UserError : r)
a
-> Sem
((Handlers !! Report)
: Log : DataLog LogReport : Resumable RpcError Rpc
: Resumable RpcError (Responses RequestId Response)
: Events (OutChan Event) Event
: PScoped () (EventChan Event) (Consume Event) : Reports
: Events (OutChan RpcMessage) RpcMessage
: PScoped () (EventChan RpcMessage) (Consume RpcMessage)
: Process RpcMessage (Either Text RpcMessage) : UserError : r)
a)
-> (Sem
(Rpc
: Log : DataLog LogReport : Resumable RpcError Rpc
: Resumable RpcError (Responses RequestId Response)
: Events (OutChan Event) Event
: PScoped () (EventChan Event) (Consume Event) : Reports
: Events (OutChan RpcMessage) RpcMessage
: PScoped () (EventChan RpcMessage) (Consume RpcMessage)
: Process RpcMessage (Either Text RpcMessage) : UserError : r)
a
-> Sem
(Rpc
: Host : (Handlers !! Report) : Log : DataLog LogReport
: Resumable RpcError Rpc
: Resumable RpcError (Responses RequestId Response)
: Events (OutChan Event) Event
: PScoped () (EventChan Event) (Consume Event) : Reports
: Events (OutChan RpcMessage) RpcMessage
: PScoped () (EventChan RpcMessage) (Consume RpcMessage)
: Process RpcMessage (Either Text RpcMessage) : UserError : r)
a)
-> Sem
(Rpc
: Log : DataLog LogReport : Resumable RpcError Rpc
: Resumable RpcError (Responses RequestId Response)
: Events (OutChan Event) Event
: PScoped () (EventChan Event) (Consume Event) : Reports
: Events (OutChan RpcMessage) RpcMessage
: PScoped () (EventChan RpcMessage) (Consume RpcMessage)
: Process RpcMessage (Either Text RpcMessage) : UserError : r)
a
-> Sem
((Handlers !! Report)
: Log : DataLog LogReport : Resumable RpcError Rpc
: Resumable RpcError (Responses RequestId Response)
: Events (OutChan Event) Event
: PScoped () (EventChan Event) (Consume Event) : Reports
: Events (OutChan RpcMessage) RpcMessage
: PScoped () (EventChan RpcMessage) (Consume RpcMessage)
: Process RpcMessage (Either Text RpcMessage) : UserError : r)
a
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
forall (index :: Nat) (inserted :: EffectRow) (head :: EffectRow)
(oldTail :: EffectRow) (tail :: EffectRow) (old :: EffectRow)
(full :: EffectRow) a.
(ListOfLength index head, WhenStuck index InsertAtUnprovidedIndex,
old ~ Append head oldTail, tail ~ Append inserted oldTail,
full ~ Append head tail,
InsertAtIndex index head tail oldTail full inserted) =>
Sem old a -> Sem full a
insertAt @1
embedNvim ::
Members BasicStack r =>
[RpcHandler (HostEmbedStack ++ r)] ->
InterpretersFor (Rpc : HostEmbedStack) r
embedNvim :: forall (r :: EffectRow).
Members BasicStack r =>
[RpcHandler (HostEmbedStack ++ r)]
-> InterpretersFor (Rpc : HostEmbedStack) r
embedNvim [RpcHandler (HostEmbedStack ++ r)]
handlers =
InterpreterFor (Handlers !! Report) (HostEmbedStack ++ r)
-> InterpretersFor (Rpc : HostEmbedStack) r
forall (r :: EffectRow).
Members BasicStack r =>
InterpreterFor (Handlers !! Report) (HostEmbedStack ++ r)
-> InterpretersFor (Rpc : HostEmbedStack) r
testHostEmbed ([RpcHandler
(Log
: DataLog LogReport : Resumable RpcError Rpc
: Resumable RpcError (Responses RequestId Response)
: Events (OutChan Event) Event
: PScoped () (EventChan Event) (Consume Event) : Reports
: Events (OutChan RpcMessage) RpcMessage
: PScoped () (EventChan RpcMessage) (Consume RpcMessage)
: Process RpcMessage (Either Text RpcMessage) : UserError : r)]
-> InterpreterFor
(Handlers !! Report)
(Log
: DataLog LogReport : Resumable RpcError Rpc
: Resumable RpcError (Responses RequestId Response)
: Events (OutChan Event) Event
: PScoped () (EventChan Event) (Consume Event) : Reports
: Events (OutChan RpcMessage) RpcMessage
: PScoped () (EventChan RpcMessage) (Consume RpcMessage)
: Process RpcMessage (Either Text RpcMessage) : UserError : r)
forall (r :: EffectRow).
Members '[Resumable RpcError Rpc, Log, Error BootError] r =>
[RpcHandler r] -> InterpreterFor (Handlers !! Report) r
interpretHandlers [RpcHandler
(Log
: DataLog LogReport : Resumable RpcError Rpc
: Resumable RpcError (Responses RequestId Response)
: Events (OutChan Event) Event
: PScoped () (EventChan Event) (Consume Event) : Reports
: Events (OutChan RpcMessage) RpcMessage
: PScoped () (EventChan RpcMessage) (Consume RpcMessage)
: Process RpcMessage (Either Text RpcMessage) : UserError : r)]
[RpcHandler (HostEmbedStack ++ r)]
handlers)
embedNvim_ ::
Members BasicStack r =>
InterpretersFor (Rpc : HostEmbedStack) r
embedNvim_ :: forall (r :: EffectRow).
Members BasicStack r =>
InterpretersFor (Rpc : HostEmbedStack) r
embedNvim_ =
InterpreterFor (Handlers !! Report) (HostEmbedStack ++ r)
-> InterpretersFor (Rpc : HostEmbedStack) r
forall (r :: EffectRow).
Members BasicStack r =>
InterpreterFor (Handlers !! Report) (HostEmbedStack ++ r)
-> InterpretersFor (Rpc : HostEmbedStack) r
testHostEmbed forall (r :: EffectRow). InterpreterFor (Handlers !! Report) r
InterpreterFor (Handlers !! Report) (HostEmbedStack ++ r)
interpretHandlersNull