{-# options_haddock prune #-}

-- |Main function combinators for embedding Neovim
module Ribosome.Embed where

import Ribosome.Data.PluginConfig (PluginConfig)
import Ribosome.Data.PluginName (PluginName)
import Ribosome.Host.Data.BootError (BootError)
import Ribosome.Host.Data.HostConfig (LogConfig)
import Ribosome.Host.Data.RpcHandler (RpcHandler)
import Ribosome.Host.Embed (EmbedExtra, interpretEmbedExtra)
import Ribosome.Host.IOStack (IOStack)
import Ribosome.Host.Interpret (HigherOrder)
import Ribosome.Host.Interpreter.Handlers (interpretHandlersNull, withHandlers)
import Ribosome.Host.Interpreter.Host (HostDeps, withHost)
import Ribosome.Host.Interpreter.Process.Embed (interpretProcessCerealNvimEmbed)
import Ribosome.Host.Run (RpcDeps, RpcStack, interpretRpcStack)
import Ribosome.IOStack (BasicPluginStack, runCli)
import Ribosome.Interpreter.Scratch (interpretScratch)
import Ribosome.Interpreter.Settings (interpretSettingsRpc)
import Ribosome.Interpreter.UserError (interpretUserErrorPrefixed)
import Ribosome.Interpreter.VariableWatcher (interpretVariableWatcherNull)
import Ribosome.Plugin.Builtin (BuiltinHandlersDeps, interceptHandlersBuiltin)
import Ribosome.Run (PluginEffects)

type HandlerEffects =
  PluginEffects ++ RpcStack ++ EmbedExtra ++ RpcDeps

-- |The complete stack for an embedded plugin test.
type EmbedStack c =
  HandlerEffects ++ BasicPluginStack c

interpretRpcDeps ::
  Members [Reader PluginName, Error BootError, Log, Resource, Race, Async, Embed IO] r =>
  InterpretersFor RpcDeps r
interpretRpcDeps :: forall (r :: [(* -> *) -> * -> *]).
Members
  '[Reader PluginName, Error BootError, Log, Resource, Race, Async,
    Embed IO]
  r =>
InterpretersFor RpcDeps r
interpretRpcDeps =
  Sem (UserError : r) a -> Sem r a
forall (r :: [(* -> *) -> * -> *]).
Member (Reader PluginName) r =>
InterpreterFor UserError r
interpretUserErrorPrefixed (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 :: [(* -> *) -> * -> *]).
(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

-- |Run the internal stack for an embedded Neovim test, without IO effects.
interpretPluginEmbed ::
  Members [Log, Reader LogConfig, Reader PluginName] r =>
  Members IOStack r =>
  InterpretersFor HandlerEffects r
interpretPluginEmbed :: forall (r :: [(* -> *) -> * -> *]).
(Members '[Log, Reader LogConfig, Reader PluginName] r,
 Members IOStack r) =>
InterpretersFor HandlerEffects r
interpretPluginEmbed =
  Sem (Process RpcMessage (Either Text RpcMessage) : UserError : r) a
-> Sem r a
forall (r :: [(* -> *) -> * -> *]).
Members
  '[Reader PluginName, 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
      (Resumable RpcError Scratch
         : Resumable SettingError Settings
         : Resumable Report VariableWatcher : (Handlers !! Report) : Log
         : DataLog LogReport : (Rpc !! RpcError)
         : 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
     (Resumable RpcError Scratch
        : Resumable SettingError Settings
        : Resumable Report VariableWatcher : (Handlers !! Report) : Log
        : DataLog LogReport : (Rpc !! RpcError)
        : 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 :: [(* -> *) -> * -> *]).
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
      (Resumable RpcError Scratch
         : Resumable SettingError Settings
         : Resumable Report VariableWatcher : (Handlers !! Report) : Log
         : DataLog LogReport : (Rpc !! RpcError)
         : 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
     (Resumable RpcError Scratch
        : Resumable SettingError Settings
        : Resumable Report VariableWatcher : (Handlers !! Report) : Log
        : DataLog LogReport : (Rpc !! RpcError)
        : 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 : (Rpc !! RpcError)
     : 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 :: [(* -> *) -> * -> *]).
(Members IOStack r, Members RpcDeps r,
 Members '[Log, Reader LogConfig] r) =>
InterpretersFor RpcStack r
interpretRpcStack (Sem
   (Log
      : DataLog LogReport : (Rpc !! RpcError)
      : 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
      (Resumable RpcError Scratch
         : Resumable SettingError Settings
         : Resumable Report VariableWatcher : (Handlers !! Report) : Log
         : DataLog LogReport : (Rpc !! RpcError)
         : 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 : (Rpc !! RpcError)
            : 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
     (Resumable RpcError Scratch
        : Resumable SettingError Settings
        : Resumable Report VariableWatcher : (Handlers !! Report) : Log
        : DataLog LogReport : (Rpc !! RpcError)
        : 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 b c a. (b -> c) -> (a -> b) -> a -> c
.
  Sem
  ((Handlers !! Report)
     : Log : DataLog LogReport : (Rpc !! RpcError)
     : 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 : (Rpc !! RpcError)
        : 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 (r :: [(* -> *) -> * -> *]).
InterpreterFor (Handlers !! Report) r
interpretHandlersNull (Sem
   ((Handlers !! Report)
      : Log : DataLog LogReport : (Rpc !! RpcError)
      : 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 : (Rpc !! RpcError)
         : 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
      (Resumable RpcError Scratch
         : Resumable SettingError Settings
         : Resumable Report VariableWatcher : (Handlers !! Report) : Log
         : DataLog LogReport : (Rpc !! RpcError)
         : 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 : (Rpc !! RpcError)
            : 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
     (Resumable RpcError Scratch
        : Resumable SettingError Settings
        : Resumable Report VariableWatcher : (Handlers !! Report) : Log
        : DataLog LogReport : (Rpc !! RpcError)
        : 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 : (Rpc !! RpcError)
        : 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
  (Resumable Report VariableWatcher
     : (Handlers !! Report) : Log : DataLog LogReport
     : (Rpc !! RpcError)
     : 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 : (Rpc !! RpcError)
        : 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 (r :: [(* -> *) -> * -> *]).
InterpreterFor (Resumable Report VariableWatcher) r
interpretVariableWatcherNull (Sem
   (Resumable Report VariableWatcher
      : (Handlers !! Report) : Log : DataLog LogReport
      : (Rpc !! RpcError)
      : 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 : (Rpc !! RpcError)
         : 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
      (Resumable RpcError Scratch
         : Resumable SettingError Settings
         : Resumable Report VariableWatcher : (Handlers !! Report) : Log
         : DataLog LogReport : (Rpc !! RpcError)
         : 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
         (Resumable Report VariableWatcher
            : (Handlers !! Report) : Log : DataLog LogReport
            : (Rpc !! RpcError)
            : 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
     (Resumable RpcError Scratch
        : Resumable SettingError Settings
        : Resumable Report VariableWatcher : (Handlers !! Report) : Log
        : DataLog LogReport : (Rpc !! RpcError)
        : 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 : (Rpc !! RpcError)
        : 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
  (Resumable SettingError Settings
     : Resumable Report VariableWatcher : (Handlers !! Report) : Log
     : DataLog LogReport : (Rpc !! RpcError)
     : 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
     (Resumable Report VariableWatcher
        : (Handlers !! Report) : Log : DataLog LogReport
        : (Rpc !! RpcError)
        : 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 (r :: [(* -> *) -> * -> *]).
Members '[Rpc !! RpcError, Reader PluginName] r =>
InterpreterFor (Resumable SettingError Settings) r
interpretSettingsRpc (Sem
   (Resumable SettingError Settings
      : Resumable Report VariableWatcher : (Handlers !! Report) : Log
      : DataLog LogReport : (Rpc !! RpcError)
      : 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
      (Resumable Report VariableWatcher
         : (Handlers !! Report) : Log : DataLog LogReport
         : (Rpc !! RpcError)
         : 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
      (Resumable RpcError Scratch
         : Resumable SettingError Settings
         : Resumable Report VariableWatcher : (Handlers !! Report) : Log
         : DataLog LogReport : (Rpc !! RpcError)
         : 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
         (Resumable SettingError Settings
            : Resumable Report VariableWatcher : (Handlers !! Report) : Log
            : DataLog LogReport : (Rpc !! RpcError)
            : 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
     (Resumable RpcError Scratch
        : Resumable SettingError Settings
        : Resumable Report VariableWatcher : (Handlers !! Report) : Log
        : DataLog LogReport : (Rpc !! RpcError)
        : 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
     (Resumable Report VariableWatcher
        : (Handlers !! Report) : Log : DataLog LogReport
        : (Rpc !! RpcError)
        : 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
  (Resumable RpcError Scratch
     : Resumable SettingError Settings
     : Resumable Report VariableWatcher : (Handlers !! Report) : Log
     : DataLog LogReport : (Rpc !! RpcError)
     : 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
     (Resumable SettingError Settings
        : Resumable Report VariableWatcher : (Handlers !! Report) : Log
        : DataLog LogReport : (Rpc !! RpcError)
        : 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 (r :: [(* -> *) -> * -> *]).
Members
  '[Rpc !! RpcError, Reader PluginName, Log, Resource, Embed IO] r =>
InterpreterFor (Resumable RpcError Scratch) r
interpretScratch

-- |Fork the main loop for a plugin connected to an embedded Neovim.
embedPlugin ::
  Members (HostDeps er) r =>
  Members BuiltinHandlersDeps r =>
  Sem r a ->
  Sem r a
embedPlugin :: forall er (r :: [(* -> *) -> * -> *]) a.
(Members (HostDeps er) r, Members BuiltinHandlersDeps r) =>
Sem r a -> Sem r a
embedPlugin =
  Sem r a -> Sem r a
forall (r :: [(* -> *) -> * -> *]) a.
Members BuiltinHandlersDeps r =>
Sem r a -> Sem r a
interceptHandlersBuiltin (Sem r a -> Sem r a) -> (Sem r a -> Sem r a) -> Sem r a -> Sem r a
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
  Sem (Host : r) a -> Sem r a
forall er (r :: [(* -> *) -> * -> *]).
Members (HostDeps er) r =>
InterpreterFor Host r
withHost (Sem (Host : r) a -> Sem r a)
-> (Sem r a -> Sem (Host : r) a) -> Sem r a -> Sem r a
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
  forall (index :: Nat) (inserted :: [(* -> *) -> * -> *])
       (head :: [(* -> *) -> * -> *]) (oldTail :: [(* -> *) -> * -> *])
       (tail :: [(* -> *) -> * -> *]) (old :: [(* -> *) -> * -> *])
       (full :: [(* -> *) -> * -> *]) 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

-- |Run an embedded Neovim, plugin internals and IO effects, reading options from the CLI.
--
-- Like 'runEmbedStack', but allows the CLI option parser to be specified.
runEmbedStackCli ::
  PluginConfig c ->
  Sem (EmbedStack c) () ->
  IO ()
runEmbedStackCli :: forall c. PluginConfig c -> Sem (EmbedStack c) () -> IO ()
runEmbedStackCli PluginConfig c
conf =
  PluginConfig c
-> Sem
     (Reader PluginName
        : Reader (CustomConfig c)
        : Append
            '[Log, Tagged "stderr" Log, Tagged "file" Log, Reader LogConfig,
              Reader HostConfig]
            IOStack)
     ()
-> IO ()
forall c. PluginConfig c -> Sem (BasicPluginStack c) () -> IO ()
runCli PluginConfig c
conf (Sem
   '[Reader PluginName, Reader (CustomConfig c), Log,
     Tagged "stderr" Log, Tagged "file" Log, Reader LogConfig,
     Reader HostConfig, Time Time Date, Error BootError,
     UninterruptibleMaskIO, UninterruptibleMaskIO, GatesIO, Race, Async,
     Resource, Embed IO, Final IO]
   ()
 -> IO ())
-> (Sem
      '[Resumable RpcError Scratch, Resumable SettingError Settings,
        Resumable Report VariableWatcher, Handlers !! Report, Log,
        DataLog LogReport, Rpc !! RpcError,
        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,
        Reader PluginName, Reader (CustomConfig c), Log,
        Tagged "stderr" Log, Tagged "file" Log, Reader LogConfig,
        Reader HostConfig, Time Time Date, Error BootError,
        UninterruptibleMaskIO, UninterruptibleMaskIO, GatesIO, Race, Async,
        Resource, Embed IO, Final IO]
      ()
    -> Sem
         '[Reader PluginName, Reader (CustomConfig c), Log,
           Tagged "stderr" Log, Tagged "file" Log, Reader LogConfig,
           Reader HostConfig, Time Time Date, Error BootError,
           UninterruptibleMaskIO, UninterruptibleMaskIO, GatesIO, Race, Async,
           Resource, Embed IO, Final IO]
         ())
-> Sem
     '[Resumable RpcError Scratch, Resumable SettingError Settings,
       Resumable Report VariableWatcher, Handlers !! Report, Log,
       DataLog LogReport, Rpc !! RpcError,
       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,
       Reader PluginName, Reader (CustomConfig c), Log,
       Tagged "stderr" Log, Tagged "file" Log, Reader LogConfig,
       Reader HostConfig, Time Time Date, Error BootError,
       UninterruptibleMaskIO, UninterruptibleMaskIO, GatesIO, Race, Async,
       Resource, Embed IO, Final IO]
     ()
-> IO ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Sem
  '[Resumable RpcError Scratch, Resumable SettingError Settings,
    Resumable Report VariableWatcher, Handlers !! Report, Log,
    DataLog LogReport, Rpc !! RpcError,
    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,
    Reader PluginName, Reader (CustomConfig c), Log,
    Tagged "stderr" Log, Tagged "file" Log, Reader LogConfig,
    Reader HostConfig, Time Time Date, Error BootError,
    UninterruptibleMaskIO, UninterruptibleMaskIO, GatesIO, Race, Async,
    Resource, Embed IO, Final IO]
  ()
-> Sem
     '[Reader PluginName, Reader (CustomConfig c), Log,
       Tagged "stderr" Log, Tagged "file" Log, Reader LogConfig,
       Reader HostConfig, Time Time Date, Error BootError,
       UninterruptibleMaskIO, UninterruptibleMaskIO, GatesIO, Race, Async,
       Resource, Embed IO, Final IO]
     ()
forall (r :: [(* -> *) -> * -> *]).
(Members '[Log, Reader LogConfig, Reader PluginName] r,
 Members IOStack r) =>
InterpretersFor HandlerEffects r
interpretPluginEmbed

-- |Run an embedded Neovim, plugin internals and IO effects, reading options from the CLI.
runEmbedStack ::
  PluginConfig () ->
  Sem (EmbedStack ()) () ->
  IO ()
runEmbedStack :: PluginConfig () -> Sem (EmbedStack ()) () -> IO ()
runEmbedStack PluginConfig ()
conf =
  PluginConfig () -> Sem (BasicPluginStack ()) () -> IO ()
forall c. PluginConfig c -> Sem (BasicPluginStack c) () -> IO ()
runCli PluginConfig ()
conf (Sem
   '[Reader PluginName, Reader (CustomConfig ()), Log,
     Tagged "stderr" Log, Tagged "file" Log, Reader LogConfig,
     Reader HostConfig, Time Time Date, Error BootError,
     UninterruptibleMaskIO, UninterruptibleMaskIO, GatesIO, Race, Async,
     Resource, Embed IO, Final IO]
   ()
 -> IO ())
-> (Sem
      '[Resumable RpcError Scratch, Resumable SettingError Settings,
        Resumable Report VariableWatcher, Handlers !! Report, Log,
        DataLog LogReport, Rpc !! RpcError,
        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,
        Reader PluginName, Reader (CustomConfig ()), Log,
        Tagged "stderr" Log, Tagged "file" Log, Reader LogConfig,
        Reader HostConfig, Time Time Date, Error BootError,
        UninterruptibleMaskIO, UninterruptibleMaskIO, GatesIO, Race, Async,
        Resource, Embed IO, Final IO]
      ()
    -> Sem
         '[Reader PluginName, Reader (CustomConfig ()), Log,
           Tagged "stderr" Log, Tagged "file" Log, Reader LogConfig,
           Reader HostConfig, Time Time Date, Error BootError,
           UninterruptibleMaskIO, UninterruptibleMaskIO, GatesIO, Race, Async,
           Resource, Embed IO, Final IO]
         ())
-> Sem
     '[Resumable RpcError Scratch, Resumable SettingError Settings,
       Resumable Report VariableWatcher, Handlers !! Report, Log,
       DataLog LogReport, Rpc !! RpcError,
       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,
       Reader PluginName, Reader (CustomConfig ()), Log,
       Tagged "stderr" Log, Tagged "file" Log, Reader LogConfig,
       Reader HostConfig, Time Time Date, Error BootError,
       UninterruptibleMaskIO, UninterruptibleMaskIO, GatesIO, Race, Async,
       Resource, Embed IO, Final IO]
     ()
-> IO ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Sem
  '[Resumable RpcError Scratch, Resumable SettingError Settings,
    Resumable Report VariableWatcher, Handlers !! Report, Log,
    DataLog LogReport, Rpc !! RpcError,
    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,
    Reader PluginName, Reader (CustomConfig ()), Log,
    Tagged "stderr" Log, Tagged "file" Log, Reader LogConfig,
    Reader HostConfig, Time Time Date, Error BootError,
    UninterruptibleMaskIO, UninterruptibleMaskIO, GatesIO, Race, Async,
    Resource, Embed IO, Final IO]
  ()
-> Sem
     '[Reader PluginName, Reader (CustomConfig ()), Log,
       Tagged "stderr" Log, Tagged "file" Log, Reader LogConfig,
       Reader HostConfig, Time Time Date, Error BootError,
       UninterruptibleMaskIO, UninterruptibleMaskIO, GatesIO, Race, Async,
       Resource, Embed IO, Final IO]
     ()
forall (r :: [(* -> *) -> * -> *]).
(Members '[Log, Reader LogConfig, Reader PluginName] r,
 Members IOStack r) =>
InterpretersFor HandlerEffects r
interpretPluginEmbed

-- |Run a 'Sem' in an embedded plugin context by starting a Neovim subprocess, forking the Ribosome main loop and
-- registering the supplied handlers, using the supplied custom effect stack.
--
-- Like 'runEmbedPluginIO', but allows the 'PluginConfig' to contain a CLI parser for an arbitrary type @c@ that is then
-- provided in a @'Reader' c@ to the plugin.
--
-- This is separate from 'runEmbedPluginIO' because it requires a type hint when using @OverloadedStrings@ or 'def' to
-- construct the config without an option parser.
runEmbedPluginCli ::
  HigherOrder r (EmbedStack c) =>
  PluginConfig c ->
  InterpretersFor r (EmbedStack c) ->
  [RpcHandler (r ++ EmbedStack c)] ->
  Sem (r ++ EmbedStack c) () ->
  IO ()
runEmbedPluginCli :: forall (r :: [(* -> *) -> * -> *]) c.
HigherOrder r (EmbedStack c) =>
PluginConfig c
-> InterpretersFor r (EmbedStack c)
-> [RpcHandler (r ++ EmbedStack c)]
-> Sem (r ++ EmbedStack c) ()
-> IO ()
runEmbedPluginCli PluginConfig c
conf InterpretersFor r (EmbedStack c)
effs [RpcHandler (r ++ EmbedStack c)]
handlers =
  PluginConfig c -> Sem (EmbedStack c) () -> IO ()
forall c. PluginConfig c -> Sem (EmbedStack c) () -> IO ()
runEmbedStackCli PluginConfig c
conf (Sem
   '[Resumable RpcError Scratch, Resumable SettingError Settings,
     Resumable Report VariableWatcher, Handlers !! Report, Log,
     DataLog LogReport, Rpc !! RpcError,
     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,
     Reader PluginName, Reader (CustomConfig c), Log,
     Tagged "stderr" Log, Tagged "file" Log, Reader LogConfig,
     Reader HostConfig, Time Time Date, Error BootError,
     UninterruptibleMaskIO, UninterruptibleMaskIO, GatesIO, Race, Async,
     Resource, Embed IO, Final IO]
   ()
 -> IO ())
-> (Sem
      (Append
         r
         '[Resumable RpcError Scratch, Resumable SettingError Settings,
           Resumable Report VariableWatcher, Handlers !! Report, Log,
           DataLog LogReport, Rpc !! RpcError,
           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,
           Reader PluginName, Reader (CustomConfig c), Log,
           Tagged "stderr" Log, Tagged "file" Log, Reader LogConfig,
           Reader HostConfig, Time Time Date, Error BootError,
           UninterruptibleMaskIO, UninterruptibleMaskIO, GatesIO, Race, Async,
           Resource, Embed IO, Final IO])
      ()
    -> Sem
         '[Resumable RpcError Scratch, Resumable SettingError Settings,
           Resumable Report VariableWatcher, Handlers !! Report, Log,
           DataLog LogReport, Rpc !! RpcError,
           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,
           Reader PluginName, Reader (CustomConfig c), Log,
           Tagged "stderr" Log, Tagged "file" Log, Reader LogConfig,
           Reader HostConfig, Time Time Date, Error BootError,
           UninterruptibleMaskIO, UninterruptibleMaskIO, GatesIO, Race, Async,
           Resource, Embed IO, Final IO]
         ())
-> Sem
     (Append
        r
        '[Resumable RpcError Scratch, Resumable SettingError Settings,
          Resumable Report VariableWatcher, Handlers !! Report, Log,
          DataLog LogReport, Rpc !! RpcError,
          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,
          Reader PluginName, Reader (CustomConfig c), Log,
          Tagged "stderr" Log, Tagged "file" Log, Reader LogConfig,
          Reader HostConfig, Time Time Date, Error BootError,
          UninterruptibleMaskIO, UninterruptibleMaskIO, GatesIO, Race, Async,
          Resource, Embed IO, Final IO])
     ()
-> IO ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
  Sem
  (Append
     r
     '[Resumable RpcError Scratch, Resumable SettingError Settings,
       Resumable Report VariableWatcher, Handlers !! Report, Log,
       DataLog LogReport, Rpc !! RpcError,
       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,
       Reader PluginName, Reader (CustomConfig c), Log,
       Tagged "stderr" Log, Tagged "file" Log, Reader LogConfig,
       Reader HostConfig, Time Time Date, Error BootError,
       UninterruptibleMaskIO, UninterruptibleMaskIO, GatesIO, Race, Async,
       Resource, Embed IO, Final IO])
  ()
-> Sem
     '[Resumable RpcError Scratch, Resumable SettingError Settings,
       Resumable Report VariableWatcher, Handlers !! Report, Log,
       DataLog LogReport, Rpc !! RpcError,
       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,
       Reader PluginName, Reader (CustomConfig c), Log,
       Tagged "stderr" Log, Tagged "file" Log, Reader LogConfig,
       Reader HostConfig, Time Time Date, Error BootError,
       UninterruptibleMaskIO, UninterruptibleMaskIO, GatesIO, Race, Async,
       Resource, Embed IO, Final IO]
     ()
InterpretersFor r (EmbedStack c)
effs (Sem
   (Append
      r
      '[Resumable RpcError Scratch, Resumable SettingError Settings,
        Resumable Report VariableWatcher, Handlers !! Report, Log,
        DataLog LogReport, Rpc !! RpcError,
        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,
        Reader PluginName, Reader (CustomConfig c), Log,
        Tagged "stderr" Log, Tagged "file" Log, Reader LogConfig,
        Reader HostConfig, Time Time Date, Error BootError,
        UninterruptibleMaskIO, UninterruptibleMaskIO, GatesIO, Race, Async,
        Resource, Embed IO, Final IO])
   ()
 -> Sem
      '[Resumable RpcError Scratch, Resumable SettingError Settings,
        Resumable Report VariableWatcher, Handlers !! Report, Log,
        DataLog LogReport, Rpc !! RpcError,
        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,
        Reader PluginName, Reader (CustomConfig c), Log,
        Tagged "stderr" Log, Tagged "file" Log, Reader LogConfig,
        Reader HostConfig, Time Time Date, Error BootError,
        UninterruptibleMaskIO, UninterruptibleMaskIO, GatesIO, Race, Async,
        Resource, Embed IO, Final IO]
      ())
-> (Sem
      (Append
         r
         '[Resumable RpcError Scratch, Resumable SettingError Settings,
           Resumable Report VariableWatcher, Handlers !! Report, Log,
           DataLog LogReport, Rpc !! RpcError,
           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,
           Reader PluginName, Reader (CustomConfig c), Log,
           Tagged "stderr" Log, Tagged "file" Log, Reader LogConfig,
           Reader HostConfig, Time Time Date, Error BootError,
           UninterruptibleMaskIO, UninterruptibleMaskIO, GatesIO, Race, Async,
           Resource, Embed IO, Final IO])
      ()
    -> Sem
         (Append
            r
            '[Resumable RpcError Scratch, Resumable SettingError Settings,
              Resumable Report VariableWatcher, Handlers !! Report, Log,
              DataLog LogReport, Rpc !! RpcError,
              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,
              Reader PluginName, Reader (CustomConfig c), Log,
              Tagged "stderr" Log, Tagged "file" Log, Reader LogConfig,
              Reader HostConfig, Time Time Date, Error BootError,
              UninterruptibleMaskIO, UninterruptibleMaskIO, GatesIO, Race, Async,
              Resource, Embed IO, Final IO])
         ())
-> Sem
     (Append
        r
        '[Resumable RpcError Scratch, Resumable SettingError Settings,
          Resumable Report VariableWatcher, Handlers !! Report, Log,
          DataLog LogReport, Rpc !! RpcError,
          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,
          Reader PluginName, Reader (CustomConfig c), Log,
          Tagged "stderr" Log, Tagged "file" Log, Reader LogConfig,
          Reader HostConfig, Time Time Date, Error BootError,
          UninterruptibleMaskIO, UninterruptibleMaskIO, GatesIO, Race, Async,
          Resource, Embed IO, Final IO])
     ()
-> Sem
     '[Resumable RpcError Scratch, Resumable SettingError Settings,
       Resumable Report VariableWatcher, Handlers !! Report, Log,
       DataLog LogReport, Rpc !! RpcError,
       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,
       Reader PluginName, Reader (CustomConfig c), Log,
       Tagged "stderr" Log, Tagged "file" Log, Reader LogConfig,
       Reader HostConfig, Time Time Date, Error BootError,
       UninterruptibleMaskIO, UninterruptibleMaskIO, GatesIO, Race, Async,
       Resource, Embed IO, Final IO]
     ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
  [RpcHandler
   (Append
      r
      '[Resumable RpcError Scratch, Resumable SettingError Settings,
        Resumable Report VariableWatcher, Handlers !! Report, Log,
        DataLog LogReport, Rpc !! RpcError,
        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,
        Reader PluginName, Reader (CustomConfig c), Log,
        Tagged "stderr" Log, Tagged "file" Log, Reader LogConfig,
        Reader HostConfig, Time Time Date, Error BootError,
        UninterruptibleMaskIO, UninterruptibleMaskIO, GatesIO, Race, Async,
        Resource, Embed IO, Final IO])]
-> Sem
     (Append
        r
        '[Resumable RpcError Scratch, Resumable SettingError Settings,
          Resumable Report VariableWatcher, Handlers !! Report, Log,
          DataLog LogReport, Rpc !! RpcError,
          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,
          Reader PluginName, Reader (CustomConfig c), Log,
          Tagged "stderr" Log, Tagged "file" Log, Reader LogConfig,
          Reader HostConfig, Time Time Date, Error BootError,
          UninterruptibleMaskIO, UninterruptibleMaskIO, GatesIO, Race, Async,
          Resource, Embed IO, Final IO])
     ()
-> Sem
     (Append
        r
        '[Resumable RpcError Scratch, Resumable SettingError Settings,
          Resumable Report VariableWatcher, Handlers !! Report, Log,
          DataLog LogReport, Rpc !! RpcError,
          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,
          Reader PluginName, Reader (CustomConfig c), Log,
          Tagged "stderr" Log, Tagged "file" Log, Reader LogConfig,
          Reader HostConfig, Time Time Date, Error BootError,
          UninterruptibleMaskIO, UninterruptibleMaskIO, GatesIO, Race, Async,
          Resource, Embed IO, Final IO])
     ()
forall (r :: [(* -> *) -> * -> *]) a.
Members
  '[Handlers !! Report, Rpc !! RpcError, Log, Error BootError] r =>
[RpcHandler r] -> Sem r a -> Sem r a
withHandlers [RpcHandler
   (Append
      r
      '[Resumable RpcError Scratch, Resumable SettingError Settings,
        Resumable Report VariableWatcher, Handlers !! Report, Log,
        DataLog LogReport, Rpc !! RpcError,
        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,
        Reader PluginName, Reader (CustomConfig c), Log,
        Tagged "stderr" Log, Tagged "file" Log, Reader LogConfig,
        Reader HostConfig, Time Time Date, Error BootError,
        UninterruptibleMaskIO, UninterruptibleMaskIO, GatesIO, Race, Async,
        Resource, Embed IO, Final IO])]
[RpcHandler (r ++ EmbedStack c)]
handlers (Sem
   (Append
      r
      '[Resumable RpcError Scratch, Resumable SettingError Settings,
        Resumable Report VariableWatcher, Handlers !! Report, Log,
        DataLog LogReport, Rpc !! RpcError,
        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,
        Reader PluginName, Reader (CustomConfig c), Log,
        Tagged "stderr" Log, Tagged "file" Log, Reader LogConfig,
        Reader HostConfig, Time Time Date, Error BootError,
        UninterruptibleMaskIO, UninterruptibleMaskIO, GatesIO, Race, Async,
        Resource, Embed IO, Final IO])
   ()
 -> Sem
      (Append
         r
         '[Resumable RpcError Scratch, Resumable SettingError Settings,
           Resumable Report VariableWatcher, Handlers !! Report, Log,
           DataLog LogReport, Rpc !! RpcError,
           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,
           Reader PluginName, Reader (CustomConfig c), Log,
           Tagged "stderr" Log, Tagged "file" Log, Reader LogConfig,
           Reader HostConfig, Time Time Date, Error BootError,
           UninterruptibleMaskIO, UninterruptibleMaskIO, GatesIO, Race, Async,
           Resource, Embed IO, Final IO])
      ())
-> (Sem
      (Append
         r
         '[Resumable RpcError Scratch, Resumable SettingError Settings,
           Resumable Report VariableWatcher, Handlers !! Report, Log,
           DataLog LogReport, Rpc !! RpcError,
           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,
           Reader PluginName, Reader (CustomConfig c), Log,
           Tagged "stderr" Log, Tagged "file" Log, Reader LogConfig,
           Reader HostConfig, Time Time Date, Error BootError,
           UninterruptibleMaskIO, UninterruptibleMaskIO, GatesIO, Race, Async,
           Resource, Embed IO, Final IO])
      ()
    -> Sem
         (Append
            r
            '[Resumable RpcError Scratch, Resumable SettingError Settings,
              Resumable Report VariableWatcher, Handlers !! Report, Log,
              DataLog LogReport, Rpc !! RpcError,
              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,
              Reader PluginName, Reader (CustomConfig c), Log,
              Tagged "stderr" Log, Tagged "file" Log, Reader LogConfig,
              Reader HostConfig, Time Time Date, Error BootError,
              UninterruptibleMaskIO, UninterruptibleMaskIO, GatesIO, Race, Async,
              Resource, Embed IO, Final IO])
         ())
-> Sem
     (Append
        r
        '[Resumable RpcError Scratch, Resumable SettingError Settings,
          Resumable Report VariableWatcher, Handlers !! Report, Log,
          DataLog LogReport, Rpc !! RpcError,
          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,
          Reader PluginName, Reader (CustomConfig c), Log,
          Tagged "stderr" Log, Tagged "file" Log, Reader LogConfig,
          Reader HostConfig, Time Time Date, Error BootError,
          UninterruptibleMaskIO, UninterruptibleMaskIO, GatesIO, Race, Async,
          Resource, Embed IO, Final IO])
     ()
-> Sem
     (Append
        r
        '[Resumable RpcError Scratch, Resumable SettingError Settings,
          Resumable Report VariableWatcher, Handlers !! Report, Log,
          DataLog LogReport, Rpc !! RpcError,
          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,
          Reader PluginName, Reader (CustomConfig c), Log,
          Tagged "stderr" Log, Tagged "file" Log, Reader LogConfig,
          Reader HostConfig, Time Time Date, Error BootError,
          UninterruptibleMaskIO, UninterruptibleMaskIO, GatesIO, Race, Async,
          Resource, Embed IO, Final IO])
     ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
  Sem
  (Append
     r
     '[Resumable RpcError Scratch, Resumable SettingError Settings,
       Resumable Report VariableWatcher, Handlers !! Report, Log,
       DataLog LogReport, Rpc !! RpcError,
       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,
       Reader PluginName, Reader (CustomConfig c), Log,
       Tagged "stderr" Log, Tagged "file" Log, Reader LogConfig,
       Reader HostConfig, Time Time Date, Error BootError,
       UninterruptibleMaskIO, UninterruptibleMaskIO, GatesIO, Race, Async,
       Resource, Embed IO, Final IO])
  ()
-> Sem
     (Append
        r
        '[Resumable RpcError Scratch, Resumable SettingError Settings,
          Resumable Report VariableWatcher, Handlers !! Report, Log,
          DataLog LogReport, Rpc !! RpcError,
          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,
          Reader PluginName, Reader (CustomConfig c), Log,
          Tagged "stderr" Log, Tagged "file" Log, Reader LogConfig,
          Reader HostConfig, Time Time Date, Error BootError,
          UninterruptibleMaskIO, UninterruptibleMaskIO, GatesIO, Race, Async,
          Resource, Embed IO, Final IO])
     ()
forall er (r :: [(* -> *) -> * -> *]) a.
(Members (HostDeps er) r, Members BuiltinHandlersDeps r) =>
Sem r a -> Sem r a
embedPlugin

-- |Run a 'Sem' in an embedded plugin context by starting a Neovim subprocess, forking the Ribosome main loop and
-- registering the supplied handlers, using the supplied custom effect stack.
--
-- This is a basic version of what
-- [ribosome-test](https://hackage.haskell.org/package/ribosome-test/docs/Ribosome-Test.html) provides, which uses
-- [polysemy-test](https://hackage.haskell.org/package/polysemy-test/docs/Polysemy-Test.html) and
-- [hedgehog](https://hackage.haskell.org/package/hedgehog) for a comprehensive testing framework.
--
-- The parameters have the same meaning as for [remote plugins]("Ribosome#execution").
runEmbedPluginIO ::
  HigherOrder r (EmbedStack ()) =>
  PluginConfig () ->
  InterpretersFor r (EmbedStack ()) ->
  [RpcHandler (r ++ EmbedStack ())] ->
  Sem (r ++ EmbedStack ()) () ->
  IO ()
runEmbedPluginIO :: forall (r :: [(* -> *) -> * -> *]).
HigherOrder r (EmbedStack ()) =>
PluginConfig ()
-> InterpretersFor r (EmbedStack ())
-> [RpcHandler (r ++ EmbedStack ())]
-> Sem (r ++ EmbedStack ()) ()
-> IO ()
runEmbedPluginIO PluginConfig ()
conf InterpretersFor r (EmbedStack ())
effs [RpcHandler (r ++ EmbedStack ())]
handlers =
  PluginConfig () -> Sem (EmbedStack ()) () -> IO ()
runEmbedStack PluginConfig ()
conf (Sem
   '[Resumable RpcError Scratch, Resumable SettingError Settings,
     Resumable Report VariableWatcher, Handlers !! Report, Log,
     DataLog LogReport, Rpc !! RpcError,
     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,
     Reader PluginName, Reader (CustomConfig ()), Log,
     Tagged "stderr" Log, Tagged "file" Log, Reader LogConfig,
     Reader HostConfig, Time Time Date, Error BootError,
     UninterruptibleMaskIO, UninterruptibleMaskIO, GatesIO, Race, Async,
     Resource, Embed IO, Final IO]
   ()
 -> IO ())
-> (Sem
      (Append
         r
         '[Resumable RpcError Scratch, Resumable SettingError Settings,
           Resumable Report VariableWatcher, Handlers !! Report, Log,
           DataLog LogReport, Rpc !! RpcError,
           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,
           Reader PluginName, Reader (CustomConfig ()), Log,
           Tagged "stderr" Log, Tagged "file" Log, Reader LogConfig,
           Reader HostConfig, Time Time Date, Error BootError,
           UninterruptibleMaskIO, UninterruptibleMaskIO, GatesIO, Race, Async,
           Resource, Embed IO, Final IO])
      ()
    -> Sem
         '[Resumable RpcError Scratch, Resumable SettingError Settings,
           Resumable Report VariableWatcher, Handlers !! Report, Log,
           DataLog LogReport, Rpc !! RpcError,
           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,
           Reader PluginName, Reader (CustomConfig ()), Log,
           Tagged "stderr" Log, Tagged "file" Log, Reader LogConfig,
           Reader HostConfig, Time Time Date, Error BootError,
           UninterruptibleMaskIO, UninterruptibleMaskIO, GatesIO, Race, Async,
           Resource, Embed IO, Final IO]
         ())
-> Sem
     (Append
        r
        '[Resumable RpcError Scratch, Resumable SettingError Settings,
          Resumable Report VariableWatcher, Handlers !! Report, Log,
          DataLog LogReport, Rpc !! RpcError,
          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,
          Reader PluginName, Reader (CustomConfig ()), Log,
          Tagged "stderr" Log, Tagged "file" Log, Reader LogConfig,
          Reader HostConfig, Time Time Date, Error BootError,
          UninterruptibleMaskIO, UninterruptibleMaskIO, GatesIO, Race, Async,
          Resource, Embed IO, Final IO])
     ()
-> IO ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
  Sem
  (Append
     r
     '[Resumable RpcError Scratch, Resumable SettingError Settings,
       Resumable Report VariableWatcher, Handlers !! Report, Log,
       DataLog LogReport, Rpc !! RpcError,
       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,
       Reader PluginName, Reader (CustomConfig ()), Log,
       Tagged "stderr" Log, Tagged "file" Log, Reader LogConfig,
       Reader HostConfig, Time Time Date, Error BootError,
       UninterruptibleMaskIO, UninterruptibleMaskIO, GatesIO, Race, Async,
       Resource, Embed IO, Final IO])
  ()
-> Sem
     '[Resumable RpcError Scratch, Resumable SettingError Settings,
       Resumable Report VariableWatcher, Handlers !! Report, Log,
       DataLog LogReport, Rpc !! RpcError,
       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,
       Reader PluginName, Reader (CustomConfig ()), Log,
       Tagged "stderr" Log, Tagged "file" Log, Reader LogConfig,
       Reader HostConfig, Time Time Date, Error BootError,
       UninterruptibleMaskIO, UninterruptibleMaskIO, GatesIO, Race, Async,
       Resource, Embed IO, Final IO]
     ()
InterpretersFor r (EmbedStack ())
effs (Sem
   (Append
      r
      '[Resumable RpcError Scratch, Resumable SettingError Settings,
        Resumable Report VariableWatcher, Handlers !! Report, Log,
        DataLog LogReport, Rpc !! RpcError,
        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,
        Reader PluginName, Reader (CustomConfig ()), Log,
        Tagged "stderr" Log, Tagged "file" Log, Reader LogConfig,
        Reader HostConfig, Time Time Date, Error BootError,
        UninterruptibleMaskIO, UninterruptibleMaskIO, GatesIO, Race, Async,
        Resource, Embed IO, Final IO])
   ()
 -> Sem
      '[Resumable RpcError Scratch, Resumable SettingError Settings,
        Resumable Report VariableWatcher, Handlers !! Report, Log,
        DataLog LogReport, Rpc !! RpcError,
        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,
        Reader PluginName, Reader (CustomConfig ()), Log,
        Tagged "stderr" Log, Tagged "file" Log, Reader LogConfig,
        Reader HostConfig, Time Time Date, Error BootError,
        UninterruptibleMaskIO, UninterruptibleMaskIO, GatesIO, Race, Async,
        Resource, Embed IO, Final IO]
      ())
-> (Sem
      (Append
         r
         '[Resumable RpcError Scratch, Resumable SettingError Settings,
           Resumable Report VariableWatcher, Handlers !! Report, Log,
           DataLog LogReport, Rpc !! RpcError,
           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,
           Reader PluginName, Reader (CustomConfig ()), Log,
           Tagged "stderr" Log, Tagged "file" Log, Reader LogConfig,
           Reader HostConfig, Time Time Date, Error BootError,
           UninterruptibleMaskIO, UninterruptibleMaskIO, GatesIO, Race, Async,
           Resource, Embed IO, Final IO])
      ()
    -> Sem
         (Append
            r
            '[Resumable RpcError Scratch, Resumable SettingError Settings,
              Resumable Report VariableWatcher, Handlers !! Report, Log,
              DataLog LogReport, Rpc !! RpcError,
              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,
              Reader PluginName, Reader (CustomConfig ()), Log,
              Tagged "stderr" Log, Tagged "file" Log, Reader LogConfig,
              Reader HostConfig, Time Time Date, Error BootError,
              UninterruptibleMaskIO, UninterruptibleMaskIO, GatesIO, Race, Async,
              Resource, Embed IO, Final IO])
         ())
-> Sem
     (Append
        r
        '[Resumable RpcError Scratch, Resumable SettingError Settings,
          Resumable Report VariableWatcher, Handlers !! Report, Log,
          DataLog LogReport, Rpc !! RpcError,
          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,
          Reader PluginName, Reader (CustomConfig ()), Log,
          Tagged "stderr" Log, Tagged "file" Log, Reader LogConfig,
          Reader HostConfig, Time Time Date, Error BootError,
          UninterruptibleMaskIO, UninterruptibleMaskIO, GatesIO, Race, Async,
          Resource, Embed IO, Final IO])
     ()
-> Sem
     '[Resumable RpcError Scratch, Resumable SettingError Settings,
       Resumable Report VariableWatcher, Handlers !! Report, Log,
       DataLog LogReport, Rpc !! RpcError,
       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,
       Reader PluginName, Reader (CustomConfig ()), Log,
       Tagged "stderr" Log, Tagged "file" Log, Reader LogConfig,
       Reader HostConfig, Time Time Date, Error BootError,
       UninterruptibleMaskIO, UninterruptibleMaskIO, GatesIO, Race, Async,
       Resource, Embed IO, Final IO]
     ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
  [RpcHandler
   (Append
      r
      '[Resumable RpcError Scratch, Resumable SettingError Settings,
        Resumable Report VariableWatcher, Handlers !! Report, Log,
        DataLog LogReport, Rpc !! RpcError,
        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,
        Reader PluginName, Reader (CustomConfig ()), Log,
        Tagged "stderr" Log, Tagged "file" Log, Reader LogConfig,
        Reader HostConfig, Time Time Date, Error BootError,
        UninterruptibleMaskIO, UninterruptibleMaskIO, GatesIO, Race, Async,
        Resource, Embed IO, Final IO])]
-> Sem
     (Append
        r
        '[Resumable RpcError Scratch, Resumable SettingError Settings,
          Resumable Report VariableWatcher, Handlers !! Report, Log,
          DataLog LogReport, Rpc !! RpcError,
          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,
          Reader PluginName, Reader (CustomConfig ()), Log,
          Tagged "stderr" Log, Tagged "file" Log, Reader LogConfig,
          Reader HostConfig, Time Time Date, Error BootError,
          UninterruptibleMaskIO, UninterruptibleMaskIO, GatesIO, Race, Async,
          Resource, Embed IO, Final IO])
     ()
-> Sem
     (Append
        r
        '[Resumable RpcError Scratch, Resumable SettingError Settings,
          Resumable Report VariableWatcher, Handlers !! Report, Log,
          DataLog LogReport, Rpc !! RpcError,
          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,
          Reader PluginName, Reader (CustomConfig ()), Log,
          Tagged "stderr" Log, Tagged "file" Log, Reader LogConfig,
          Reader HostConfig, Time Time Date, Error BootError,
          UninterruptibleMaskIO, UninterruptibleMaskIO, GatesIO, Race, Async,
          Resource, Embed IO, Final IO])
     ()
forall (r :: [(* -> *) -> * -> *]) a.
Members
  '[Handlers !! Report, Rpc !! RpcError, Log, Error BootError] r =>
[RpcHandler r] -> Sem r a -> Sem r a
withHandlers [RpcHandler
   (Append
      r
      '[Resumable RpcError Scratch, Resumable SettingError Settings,
        Resumable Report VariableWatcher, Handlers !! Report, Log,
        DataLog LogReport, Rpc !! RpcError,
        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,
        Reader PluginName, Reader (CustomConfig ()), Log,
        Tagged "stderr" Log, Tagged "file" Log, Reader LogConfig,
        Reader HostConfig, Time Time Date, Error BootError,
        UninterruptibleMaskIO, UninterruptibleMaskIO, GatesIO, Race, Async,
        Resource, Embed IO, Final IO])]
[RpcHandler (r ++ EmbedStack ())]
handlers (Sem
   (Append
      r
      '[Resumable RpcError Scratch, Resumable SettingError Settings,
        Resumable Report VariableWatcher, Handlers !! Report, Log,
        DataLog LogReport, Rpc !! RpcError,
        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,
        Reader PluginName, Reader (CustomConfig ()), Log,
        Tagged "stderr" Log, Tagged "file" Log, Reader LogConfig,
        Reader HostConfig, Time Time Date, Error BootError,
        UninterruptibleMaskIO, UninterruptibleMaskIO, GatesIO, Race, Async,
        Resource, Embed IO, Final IO])
   ()
 -> Sem
      (Append
         r
         '[Resumable RpcError Scratch, Resumable SettingError Settings,
           Resumable Report VariableWatcher, Handlers !! Report, Log,
           DataLog LogReport, Rpc !! RpcError,
           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,
           Reader PluginName, Reader (CustomConfig ()), Log,
           Tagged "stderr" Log, Tagged "file" Log, Reader LogConfig,
           Reader HostConfig, Time Time Date, Error BootError,
           UninterruptibleMaskIO, UninterruptibleMaskIO, GatesIO, Race, Async,
           Resource, Embed IO, Final IO])
      ())
-> (Sem
      (Append
         r
         '[Resumable RpcError Scratch, Resumable SettingError Settings,
           Resumable Report VariableWatcher, Handlers !! Report, Log,
           DataLog LogReport, Rpc !! RpcError,
           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,
           Reader PluginName, Reader (CustomConfig ()), Log,
           Tagged "stderr" Log, Tagged "file" Log, Reader LogConfig,
           Reader HostConfig, Time Time Date, Error BootError,
           UninterruptibleMaskIO, UninterruptibleMaskIO, GatesIO, Race, Async,
           Resource, Embed IO, Final IO])
      ()
    -> Sem
         (Append
            r
            '[Resumable RpcError Scratch, Resumable SettingError Settings,
              Resumable Report VariableWatcher, Handlers !! Report, Log,
              DataLog LogReport, Rpc !! RpcError,
              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,
              Reader PluginName, Reader (CustomConfig ()), Log,
              Tagged "stderr" Log, Tagged "file" Log, Reader LogConfig,
              Reader HostConfig, Time Time Date, Error BootError,
              UninterruptibleMaskIO, UninterruptibleMaskIO, GatesIO, Race, Async,
              Resource, Embed IO, Final IO])
         ())
-> Sem
     (Append
        r
        '[Resumable RpcError Scratch, Resumable SettingError Settings,
          Resumable Report VariableWatcher, Handlers !! Report, Log,
          DataLog LogReport, Rpc !! RpcError,
          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,
          Reader PluginName, Reader (CustomConfig ()), Log,
          Tagged "stderr" Log, Tagged "file" Log, Reader LogConfig,
          Reader HostConfig, Time Time Date, Error BootError,
          UninterruptibleMaskIO, UninterruptibleMaskIO, GatesIO, Race, Async,
          Resource, Embed IO, Final IO])
     ()
-> Sem
     (Append
        r
        '[Resumable RpcError Scratch, Resumable SettingError Settings,
          Resumable Report VariableWatcher, Handlers !! Report, Log,
          DataLog LogReport, Rpc !! RpcError,
          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,
          Reader PluginName, Reader (CustomConfig ()), Log,
          Tagged "stderr" Log, Tagged "file" Log, Reader LogConfig,
          Reader HostConfig, Time Time Date, Error BootError,
          UninterruptibleMaskIO, UninterruptibleMaskIO, GatesIO, Race, Async,
          Resource, Embed IO, Final IO])
     ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
  Sem
  (Append
     r
     '[Resumable RpcError Scratch, Resumable SettingError Settings,
       Resumable Report VariableWatcher, Handlers !! Report, Log,
       DataLog LogReport, Rpc !! RpcError,
       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,
       Reader PluginName, Reader (CustomConfig ()), Log,
       Tagged "stderr" Log, Tagged "file" Log, Reader LogConfig,
       Reader HostConfig, Time Time Date, Error BootError,
       UninterruptibleMaskIO, UninterruptibleMaskIO, GatesIO, Race, Async,
       Resource, Embed IO, Final IO])
  ()
-> Sem
     (Append
        r
        '[Resumable RpcError Scratch, Resumable SettingError Settings,
          Resumable Report VariableWatcher, Handlers !! Report, Log,
          DataLog LogReport, Rpc !! RpcError,
          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,
          Reader PluginName, Reader (CustomConfig ()), Log,
          Tagged "stderr" Log, Tagged "file" Log, Reader LogConfig,
          Reader HostConfig, Time Time Date, Error BootError,
          UninterruptibleMaskIO, UninterruptibleMaskIO, GatesIO, Race, Async,
          Resource, Embed IO, Final IO])
     ()
forall er (r :: [(* -> *) -> * -> *]) a.
(Members (HostDeps er) r, Members BuiltinHandlersDeps r) =>
Sem r a -> Sem r a
embedPlugin

-- |Run a 'Sem' in an embedded plugin context by starting a Neovim subprocess, forking the Ribosome main loop and
-- registering the supplied handlers.
--
-- Like 'runEmbedPluginIO', but without extra effects.
runEmbedPluginIO_ ::
  PluginConfig () ->
  [RpcHandler (EmbedStack ())] ->
  Sem (EmbedStack ()) () ->
  IO ()
runEmbedPluginIO_ :: PluginConfig ()
-> [RpcHandler (EmbedStack ())] -> Sem (EmbedStack ()) () -> IO ()
runEmbedPluginIO_ PluginConfig ()
conf [RpcHandler (EmbedStack ())]
handlers =
  PluginConfig () -> Sem (EmbedStack ()) () -> IO ()
runEmbedStack PluginConfig ()
conf (Sem
   '[Resumable RpcError Scratch, Resumable SettingError Settings,
     Resumable Report VariableWatcher, Handlers !! Report, Log,
     DataLog LogReport, Rpc !! RpcError,
     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,
     Reader PluginName, Reader (CustomConfig ()), Log,
     Tagged "stderr" Log, Tagged "file" Log, Reader LogConfig,
     Reader HostConfig, Time Time Date, Error BootError,
     UninterruptibleMaskIO, UninterruptibleMaskIO, GatesIO, Race, Async,
     Resource, Embed IO, Final IO]
   ()
 -> IO ())
-> (Sem
      '[Resumable RpcError Scratch, Resumable SettingError Settings,
        Resumable Report VariableWatcher, Handlers !! Report, Log,
        DataLog LogReport, Rpc !! RpcError,
        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,
        Reader PluginName, Reader (CustomConfig ()), Log,
        Tagged "stderr" Log, Tagged "file" Log, Reader LogConfig,
        Reader HostConfig, Time Time Date, Error BootError,
        UninterruptibleMaskIO, UninterruptibleMaskIO, GatesIO, Race, Async,
        Resource, Embed IO, Final IO]
      ()
    -> Sem
         '[Resumable RpcError Scratch, Resumable SettingError Settings,
           Resumable Report VariableWatcher, Handlers !! Report, Log,
           DataLog LogReport, Rpc !! RpcError,
           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,
           Reader PluginName, Reader (CustomConfig ()), Log,
           Tagged "stderr" Log, Tagged "file" Log, Reader LogConfig,
           Reader HostConfig, Time Time Date, Error BootError,
           UninterruptibleMaskIO, UninterruptibleMaskIO, GatesIO, Race, Async,
           Resource, Embed IO, Final IO]
         ())
-> Sem
     '[Resumable RpcError Scratch, Resumable SettingError Settings,
       Resumable Report VariableWatcher, Handlers !! Report, Log,
       DataLog LogReport, Rpc !! RpcError,
       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,
       Reader PluginName, Reader (CustomConfig ()), Log,
       Tagged "stderr" Log, Tagged "file" Log, Reader LogConfig,
       Reader HostConfig, Time Time Date, Error BootError,
       UninterruptibleMaskIO, UninterruptibleMaskIO, GatesIO, Race, Async,
       Resource, Embed IO, Final IO]
     ()
-> IO ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
  [RpcHandler
   '[Resumable RpcError Scratch, Resumable SettingError Settings,
     Resumable Report VariableWatcher, Handlers !! Report, Log,
     DataLog LogReport, Rpc !! RpcError,
     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,
     Reader PluginName, Reader (CustomConfig ()), Log,
     Tagged "stderr" Log, Tagged "file" Log, Reader LogConfig,
     Reader HostConfig, Time Time Date, Error BootError,
     UninterruptibleMaskIO, UninterruptibleMaskIO, GatesIO, Race, Async,
     Resource, Embed IO, Final IO]]
-> Sem
     '[Resumable RpcError Scratch, Resumable SettingError Settings,
       Resumable Report VariableWatcher, Handlers !! Report, Log,
       DataLog LogReport, Rpc !! RpcError,
       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,
       Reader PluginName, Reader (CustomConfig ()), Log,
       Tagged "stderr" Log, Tagged "file" Log, Reader LogConfig,
       Reader HostConfig, Time Time Date, Error BootError,
       UninterruptibleMaskIO, UninterruptibleMaskIO, GatesIO, Race, Async,
       Resource, Embed IO, Final IO]
     ()
-> Sem
     '[Resumable RpcError Scratch, Resumable SettingError Settings,
       Resumable Report VariableWatcher, Handlers !! Report, Log,
       DataLog LogReport, Rpc !! RpcError,
       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,
       Reader PluginName, Reader (CustomConfig ()), Log,
       Tagged "stderr" Log, Tagged "file" Log, Reader LogConfig,
       Reader HostConfig, Time Time Date, Error BootError,
       UninterruptibleMaskIO, UninterruptibleMaskIO, GatesIO, Race, Async,
       Resource, Embed IO, Final IO]
     ()
forall (r :: [(* -> *) -> * -> *]) a.
Members
  '[Handlers !! Report, Rpc !! RpcError, Log, Error BootError] r =>
[RpcHandler r] -> Sem r a -> Sem r a
withHandlers [RpcHandler
   '[Resumable RpcError Scratch, Resumable SettingError Settings,
     Resumable Report VariableWatcher, Handlers !! Report, Log,
     DataLog LogReport, Rpc !! RpcError,
     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,
     Reader PluginName, Reader (CustomConfig ()), Log,
     Tagged "stderr" Log, Tagged "file" Log, Reader LogConfig,
     Reader HostConfig, Time Time Date, Error BootError,
     UninterruptibleMaskIO, UninterruptibleMaskIO, GatesIO, Race, Async,
     Resource, Embed IO, Final IO]]
[RpcHandler (EmbedStack ())]
handlers (Sem
   '[Resumable RpcError Scratch, Resumable SettingError Settings,
     Resumable Report VariableWatcher, Handlers !! Report, Log,
     DataLog LogReport, Rpc !! RpcError,
     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,
     Reader PluginName, Reader (CustomConfig ()), Log,
     Tagged "stderr" Log, Tagged "file" Log, Reader LogConfig,
     Reader HostConfig, Time Time Date, Error BootError,
     UninterruptibleMaskIO, UninterruptibleMaskIO, GatesIO, Race, Async,
     Resource, Embed IO, Final IO]
   ()
 -> Sem
      '[Resumable RpcError Scratch, Resumable SettingError Settings,
        Resumable Report VariableWatcher, Handlers !! Report, Log,
        DataLog LogReport, Rpc !! RpcError,
        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,
        Reader PluginName, Reader (CustomConfig ()), Log,
        Tagged "stderr" Log, Tagged "file" Log, Reader LogConfig,
        Reader HostConfig, Time Time Date, Error BootError,
        UninterruptibleMaskIO, UninterruptibleMaskIO, GatesIO, Race, Async,
        Resource, Embed IO, Final IO]
      ())
-> (Sem
      '[Resumable RpcError Scratch, Resumable SettingError Settings,
        Resumable Report VariableWatcher, Handlers !! Report, Log,
        DataLog LogReport, Rpc !! RpcError,
        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,
        Reader PluginName, Reader (CustomConfig ()), Log,
        Tagged "stderr" Log, Tagged "file" Log, Reader LogConfig,
        Reader HostConfig, Time Time Date, Error BootError,
        UninterruptibleMaskIO, UninterruptibleMaskIO, GatesIO, Race, Async,
        Resource, Embed IO, Final IO]
      ()
    -> Sem
         '[Resumable RpcError Scratch, Resumable SettingError Settings,
           Resumable Report VariableWatcher, Handlers !! Report, Log,
           DataLog LogReport, Rpc !! RpcError,
           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,
           Reader PluginName, Reader (CustomConfig ()), Log,
           Tagged "stderr" Log, Tagged "file" Log, Reader LogConfig,
           Reader HostConfig, Time Time Date, Error BootError,
           UninterruptibleMaskIO, UninterruptibleMaskIO, GatesIO, Race, Async,
           Resource, Embed IO, Final IO]
         ())
-> Sem
     '[Resumable RpcError Scratch, Resumable SettingError Settings,
       Resumable Report VariableWatcher, Handlers !! Report, Log,
       DataLog LogReport, Rpc !! RpcError,
       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,
       Reader PluginName, Reader (CustomConfig ()), Log,
       Tagged "stderr" Log, Tagged "file" Log, Reader LogConfig,
       Reader HostConfig, Time Time Date, Error BootError,
       UninterruptibleMaskIO, UninterruptibleMaskIO, GatesIO, Race, Async,
       Resource, Embed IO, Final IO]
     ()
-> Sem
     '[Resumable RpcError Scratch, Resumable SettingError Settings,
       Resumable Report VariableWatcher, Handlers !! Report, Log,
       DataLog LogReport, Rpc !! RpcError,
       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,
       Reader PluginName, Reader (CustomConfig ()), Log,
       Tagged "stderr" Log, Tagged "file" Log, Reader LogConfig,
       Reader HostConfig, Time Time Date, Error BootError,
       UninterruptibleMaskIO, UninterruptibleMaskIO, GatesIO, Race, Async,
       Resource, Embed IO, Final IO]
     ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
  Sem
  '[Resumable RpcError Scratch, Resumable SettingError Settings,
    Resumable Report VariableWatcher, Handlers !! Report, Log,
    DataLog LogReport, Rpc !! RpcError,
    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,
    Reader PluginName, Reader (CustomConfig ()), Log,
    Tagged "stderr" Log, Tagged "file" Log, Reader LogConfig,
    Reader HostConfig, Time Time Date, Error BootError,
    UninterruptibleMaskIO, UninterruptibleMaskIO, GatesIO, Race, Async,
    Resource, Embed IO, Final IO]
  ()
-> Sem
     '[Resumable RpcError Scratch, Resumable SettingError Settings,
       Resumable Report VariableWatcher, Handlers !! Report, Log,
       DataLog LogReport, Rpc !! RpcError,
       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,
       Reader PluginName, Reader (CustomConfig ()), Log,
       Tagged "stderr" Log, Tagged "file" Log, Reader LogConfig,
       Reader HostConfig, Time Time Date, Error BootError,
       UninterruptibleMaskIO, UninterruptibleMaskIO, GatesIO, Race, Async,
       Resource, Embed IO, Final IO]
     ()
forall er (r :: [(* -> *) -> * -> *]) a.
(Members (HostDeps er) r, Members BuiltinHandlersDeps r) =>
Sem r a -> Sem r a
embedPlugin