module Ribosome.Host.Socket where

import Ribosome.Host.Data.BootError (BootError (BootError))
import Ribosome.Host.Data.NvimSocket (NvimSocket)
import Ribosome.Host.Data.Report (Report)
import Ribosome.Host.Data.RpcHandler (RpcHandler)
import Ribosome.Host.Effect.Handlers (Handlers)
import Ribosome.Host.Effect.Rpc (Rpc)
import Ribosome.Host.IOStack (BasicStack)
import Ribosome.Host.Interpreter.Handlers (interpretHandlers, interpretHandlersNull)
import Ribosome.Host.Interpreter.Host (testHost, withHost)
import Ribosome.Host.Interpreter.Process.Socket (interpretProcessCerealSocket)
import Ribosome.Host.Interpreter.UserError (interpretUserErrorInfo)
import Ribosome.Host.Run (RpcDeps, RpcStack, interpretRpcStack)

type HostSocketStack =
  RpcStack ++ RpcDeps

interpretRpcDeps ::
  Members [Reader NvimSocket, Error BootError, Log, Resource, Race, Async, Embed IO] r =>
  InterpretersFor RpcDeps r
interpretRpcDeps :: forall (r :: EffectRow).
Members
  '[Reader NvimSocket, Error BootError, Log, Resource, Race, Async,
    Embed IO]
  r =>
InterpretersFor RpcDeps r
interpretRpcDeps =
  Sem (UserError : r) a -> Sem r a
forall (r :: EffectRow). InterpreterFor UserError r
interpretUserErrorInfo (Sem (UserError : r) a -> Sem r a)
-> (Sem
      (Process RpcMessage (Either Text RpcMessage) : UserError : r) a
    -> Sem (UserError : r) a)
-> Sem
     (Process RpcMessage (Either Text RpcMessage) : UserError : r) a
-> Sem r a
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
  ProcessOptions
-> InterpreterFor
     (Resumable
        ProcessError (Process RpcMessage (Either Text RpcMessage)))
     (UserError : r)
forall a (r :: EffectRow).
(Serialize a,
 Members
   '[Reader NvimSocket, Error BootError, Log, Resource, Race, Async,
     Embed IO]
   r) =>
ProcessOptions
-> InterpreterFor (Process a (Either Text a) !! ProcessError) r
interpretProcessCerealSocket ProcessOptions
forall a. Default a => a
def (Sem
   (Resumable
      ProcessError (Process RpcMessage (Either Text RpcMessage))
      : UserError : r)
   a
 -> Sem (UserError : r) a)
-> (Sem
      (Process RpcMessage (Either Text RpcMessage) : UserError : r) a
    -> Sem
         (Resumable
            ProcessError (Process RpcMessage (Either Text RpcMessage))
            : UserError : r)
         a)
-> Sem
     (Process RpcMessage (Either Text RpcMessage) : UserError : r) a
-> Sem (UserError : r) a
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
  (ProcessError -> BootError)
-> Sem
     (Process RpcMessage (Either Text RpcMessage)
        : Resumable
            ProcessError (Process RpcMessage (Either Text RpcMessage))
        : UserError : r)
     a
-> Sem
     (Resumable
        ProcessError (Process RpcMessage (Either Text RpcMessage))
        : UserError : r)
     a
forall err (eff :: (* -> *) -> * -> *) err' (r :: EffectRow) a.
Members '[Resumable err eff, Error err'] r =>
(err -> err') -> Sem (eff : r) a -> Sem r a
resumeHoistError (Text -> BootError
BootError (Text -> BootError)
-> (ProcessError -> Text) -> ProcessError -> BootError
forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall b a. (Show a, IsString b) => a -> b
show @Text) (Sem
   (Process RpcMessage (Either Text RpcMessage)
      : Resumable
          ProcessError (Process RpcMessage (Either Text RpcMessage))
      : UserError : r)
   a
 -> Sem
      (Resumable
         ProcessError (Process RpcMessage (Either Text RpcMessage))
         : UserError : r)
      a)
-> (Sem
      (Process RpcMessage (Either Text RpcMessage) : UserError : r) a
    -> Sem
         (Process RpcMessage (Either Text RpcMessage)
            : Resumable
                ProcessError (Process RpcMessage (Either Text RpcMessage))
            : UserError : r)
         a)
-> Sem
     (Process RpcMessage (Either Text RpcMessage) : UserError : r) a
-> Sem
     (Resumable
        ProcessError (Process RpcMessage (Either Text RpcMessage))
        : UserError : r)
     a
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
  Sem (Process RpcMessage (Either Text RpcMessage) : UserError : r) a
-> Sem
     (Process RpcMessage (Either Text RpcMessage)
        : Resumable
            ProcessError (Process RpcMessage (Either Text RpcMessage))
        : UserError : r)
     a
forall (e2 :: (* -> *) -> * -> *) (e1 :: (* -> *) -> * -> *)
       (r :: EffectRow) a.
Sem (e1 : r) a -> Sem (e1 : e2 : r) a
raiseUnder

interpretHostSocket ::
  Members BasicStack r =>
  Member (Reader NvimSocket) r =>
  InterpretersFor HostSocketStack r
interpretHostSocket :: forall (r :: EffectRow).
(Members BasicStack r, Member (Reader NvimSocket) r) =>
InterpretersFor HostSocketStack r
interpretHostSocket =
  Sem (Process RpcMessage (Either Text RpcMessage) : UserError : r) a
-> Sem r a
forall (r :: EffectRow).
Members
  '[Reader NvimSocket, Error BootError, Log, Resource, Race, Async,
    Embed IO]
  r =>
InterpretersFor RpcDeps r
interpretRpcDeps (Sem
   (Process RpcMessage (Either Text RpcMessage) : UserError : r) a
 -> Sem r a)
-> (Sem
      (Log
         : DataLog LogReport : Resumable RpcError Rpc
         : Resumable RpcError (Responses RequestId Response)
         : Events (OutChan Event) Event
         : PScoped () (EventChan Event) (Consume Event) : Reports
         : Process RpcMessage (Either Text RpcMessage) : UserError : r)
      a
    -> Sem
         (Process RpcMessage (Either Text RpcMessage) : UserError : r) a)
-> Sem
     (Log
        : DataLog LogReport : Resumable RpcError Rpc
        : Resumable RpcError (Responses RequestId Response)
        : Events (OutChan Event) Event
        : PScoped () (EventChan Event) (Consume Event) : Reports
        : Process RpcMessage (Either Text RpcMessage) : UserError : r)
     a
-> Sem r a
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
  Sem
  (Log
     : DataLog LogReport : Resumable RpcError Rpc
     : Resumable RpcError (Responses RequestId Response)
     : Events (OutChan Event) Event
     : PScoped () (EventChan Event) (Consume Event) : Reports
     : Process RpcMessage (Either Text RpcMessage) : UserError : r)
  a
-> Sem
     (Process RpcMessage (Either Text RpcMessage) : UserError : r) a
forall (r :: EffectRow).
(Members IOStack r, Members RpcDeps r,
 Members '[Log, Reader LogConfig] r) =>
InterpretersFor RpcStack r
interpretRpcStack

withHostSocket ::
  Members BasicStack r =>
  Member (Reader NvimSocket) r =>
  InterpreterFor (Handlers !! Report) (HostSocketStack ++ r) ->
  InterpretersFor HostSocketStack r
withHostSocket :: forall (r :: EffectRow).
(Members BasicStack r, Member (Reader NvimSocket) r) =>
InterpreterFor (Handlers !! Report) (HostSocketStack ++ r)
-> InterpretersFor HostSocketStack r
withHostSocket InterpreterFor (Handlers !! Report) (HostSocketStack ++ r)
handlers =
  Sem
  (Log
     : DataLog LogReport : Resumable RpcError Rpc
     : Resumable RpcError (Responses RequestId Response)
     : Events (OutChan Event) Event
     : PScoped () (EventChan Event) (Consume Event) : Reports
     : Process RpcMessage (Either Text RpcMessage) : UserError : r)
  a
-> Sem r a
forall (r :: EffectRow).
(Members BasicStack r, Member (Reader NvimSocket) r) =>
InterpretersFor HostSocketStack r
interpretHostSocket (Sem
   (Log
      : DataLog LogReport : Resumable RpcError Rpc
      : Resumable RpcError (Responses RequestId Response)
      : Events (OutChan Event) Event
      : PScoped () (EventChan Event) (Consume Event) : Reports
      : Process RpcMessage (Either Text RpcMessage) : UserError : r)
   a
 -> Sem r a)
-> (Sem
      (Log
         : DataLog LogReport : Resumable RpcError Rpc
         : Resumable RpcError (Responses RequestId Response)
         : Events (OutChan Event) Event
         : PScoped () (EventChan Event) (Consume Event) : Reports
         : Process RpcMessage (Either Text RpcMessage) : UserError : r)
      a
    -> Sem
         (Log
            : DataLog LogReport : Resumable RpcError Rpc
            : Resumable RpcError (Responses RequestId Response)
            : Events (OutChan Event) Event
            : PScoped () (EventChan Event) (Consume Event) : Reports
            : Process RpcMessage (Either Text RpcMessage) : UserError : r)
         a)
-> Sem
     (Log
        : DataLog LogReport : Resumable RpcError Rpc
        : Resumable RpcError (Responses RequestId Response)
        : Events (OutChan Event) Event
        : PScoped () (EventChan Event) (Consume Event) : Reports
        : Process RpcMessage (Either Text RpcMessage) : UserError : r)
     a
-> Sem r a
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
  Sem
  ((Handlers !! Report)
     : Log : DataLog LogReport : Resumable RpcError Rpc
     : Resumable RpcError (Responses RequestId Response)
     : Events (OutChan Event) Event
     : PScoped () (EventChan Event) (Consume Event) : Reports
     : Process RpcMessage (Either Text RpcMessage) : UserError : r)
  a
-> Sem
     (Log
        : DataLog LogReport : Resumable RpcError Rpc
        : Resumable RpcError (Responses RequestId Response)
        : Events (OutChan Event) Event
        : PScoped () (EventChan Event) (Consume Event) : Reports
        : Process RpcMessage (Either Text RpcMessage) : UserError : r)
     a
InterpreterFor (Handlers !! Report) (HostSocketStack ++ r)
handlers (Sem
   ((Handlers !! Report)
      : Log : DataLog LogReport : Resumable RpcError Rpc
      : Resumable RpcError (Responses RequestId Response)
      : Events (OutChan Event) Event
      : PScoped () (EventChan Event) (Consume Event) : Reports
      : Process RpcMessage (Either Text RpcMessage) : UserError : r)
   a
 -> Sem
      (Log
         : DataLog LogReport : Resumable RpcError Rpc
         : Resumable RpcError (Responses RequestId Response)
         : Events (OutChan Event) Event
         : PScoped () (EventChan Event) (Consume Event) : Reports
         : Process RpcMessage (Either Text RpcMessage) : UserError : r)
      a)
-> (Sem
      (Log
         : DataLog LogReport : Resumable RpcError Rpc
         : Resumable RpcError (Responses RequestId Response)
         : Events (OutChan Event) Event
         : PScoped () (EventChan Event) (Consume Event) : Reports
         : Process RpcMessage (Either Text RpcMessage) : UserError : r)
      a
    -> Sem
         ((Handlers !! Report)
            : Log : DataLog LogReport : Resumable RpcError Rpc
            : Resumable RpcError (Responses RequestId Response)
            : Events (OutChan Event) Event
            : PScoped () (EventChan Event) (Consume Event) : Reports
            : Process RpcMessage (Either Text RpcMessage) : UserError : r)
         a)
-> Sem
     (Log
        : DataLog LogReport : Resumable RpcError Rpc
        : Resumable RpcError (Responses RequestId Response)
        : Events (OutChan Event) Event
        : PScoped () (EventChan Event) (Consume Event) : Reports
        : Process RpcMessage (Either Text RpcMessage) : UserError : r)
     a
-> Sem
     (Log
        : DataLog LogReport : Resumable RpcError Rpc
        : Resumable RpcError (Responses RequestId Response)
        : Events (OutChan Event) Event
        : PScoped () (EventChan Event) (Consume Event) : Reports
        : Process RpcMessage (Either Text RpcMessage) : UserError : r)
     a
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
  Sem
  (Host
     : (Handlers !! Report) : Log : DataLog LogReport
     : Resumable RpcError Rpc
     : Resumable RpcError (Responses RequestId Response)
     : Events (OutChan Event) Event
     : PScoped () (EventChan Event) (Consume Event) : Reports
     : Process RpcMessage (Either Text RpcMessage) : UserError : r)
  a
-> Sem
     ((Handlers !! Report)
        : Log : DataLog LogReport : Resumable RpcError Rpc
        : Resumable RpcError (Responses RequestId Response)
        : Events (OutChan Event) Event
        : PScoped () (EventChan Event) (Consume Event) : Reports
        : Process RpcMessage (Either Text RpcMessage) : UserError : r)
     a
forall er (r :: EffectRow).
Members (HostDeps er) r =>
InterpreterFor Host r
withHost (Sem
   (Host
      : (Handlers !! Report) : Log : DataLog LogReport
      : Resumable RpcError Rpc
      : Resumable RpcError (Responses RequestId Response)
      : Events (OutChan Event) Event
      : PScoped () (EventChan Event) (Consume Event) : Reports
      : Process RpcMessage (Either Text RpcMessage) : UserError : r)
   a
 -> Sem
      ((Handlers !! Report)
         : Log : DataLog LogReport : Resumable RpcError Rpc
         : Resumable RpcError (Responses RequestId Response)
         : Events (OutChan Event) Event
         : PScoped () (EventChan Event) (Consume Event) : Reports
         : Process RpcMessage (Either Text RpcMessage) : UserError : r)
      a)
-> (Sem
      (Log
         : DataLog LogReport : Resumable RpcError Rpc
         : Resumable RpcError (Responses RequestId Response)
         : Events (OutChan Event) Event
         : PScoped () (EventChan Event) (Consume Event) : Reports
         : Process RpcMessage (Either Text RpcMessage) : UserError : r)
      a
    -> Sem
         (Host
            : (Handlers !! Report) : Log : DataLog LogReport
            : Resumable RpcError Rpc
            : Resumable RpcError (Responses RequestId Response)
            : Events (OutChan Event) Event
            : PScoped () (EventChan Event) (Consume Event) : Reports
            : Process RpcMessage (Either Text RpcMessage) : UserError : r)
         a)
-> Sem
     (Log
        : DataLog LogReport : Resumable RpcError Rpc
        : Resumable RpcError (Responses RequestId Response)
        : Events (OutChan Event) Event
        : PScoped () (EventChan Event) (Consume Event) : Reports
        : Process RpcMessage (Either Text RpcMessage) : UserError : r)
     a
-> Sem
     ((Handlers !! Report)
        : Log : DataLog LogReport : Resumable RpcError Rpc
        : Resumable RpcError (Responses RequestId Response)
        : Events (OutChan Event) Event
        : PScoped () (EventChan Event) (Consume Event) : Reports
        : Process RpcMessage (Either Text RpcMessage) : UserError : r)
     a
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
  forall (index :: Nat) (inserted :: EffectRow) (head :: EffectRow)
       (oldTail :: EffectRow) (tail :: EffectRow) (old :: EffectRow)
       (full :: EffectRow) a.
(ListOfLength index head, WhenStuck index InsertAtUnprovidedIndex,
 old ~ Append head oldTail, tail ~ Append inserted oldTail,
 full ~ Append head tail,
 InsertAtIndex index head tail oldTail full inserted) =>
Sem old a -> Sem full a
insertAt @0

testHostSocket ::
  Members BasicStack r =>
  Member (Reader NvimSocket) r =>
  InterpreterFor (Handlers !! Report) (HostSocketStack ++ r) ->
  InterpretersFor (Rpc : HostSocketStack) r
testHostSocket :: forall (r :: EffectRow).
(Members BasicStack r, Member (Reader NvimSocket) r) =>
InterpreterFor (Handlers !! Report) (HostSocketStack ++ r)
-> InterpretersFor (Rpc : HostSocketStack) r
testHostSocket InterpreterFor (Handlers !! Report) (HostSocketStack ++ r)
handlers =
  Sem
  (Log
     : DataLog LogReport : Resumable RpcError Rpc
     : Resumable RpcError (Responses RequestId Response)
     : Events (OutChan Event) Event
     : PScoped () (EventChan Event) (Consume Event) : Reports
     : Process RpcMessage (Either Text RpcMessage) : UserError : r)
  a
-> Sem r a
forall (r :: EffectRow).
(Members BasicStack r, Member (Reader NvimSocket) r) =>
InterpretersFor HostSocketStack r
interpretHostSocket (Sem
   (Log
      : DataLog LogReport : Resumable RpcError Rpc
      : Resumable RpcError (Responses RequestId Response)
      : Events (OutChan Event) Event
      : PScoped () (EventChan Event) (Consume Event) : Reports
      : Process RpcMessage (Either Text RpcMessage) : UserError : r)
   a
 -> Sem r a)
-> (Sem
      (Rpc
         : Log : DataLog LogReport : Resumable RpcError Rpc
         : Resumable RpcError (Responses RequestId Response)
         : Events (OutChan Event) Event
         : PScoped () (EventChan Event) (Consume Event) : Reports
         : Process RpcMessage (Either Text RpcMessage) : UserError : r)
      a
    -> Sem
         (Log
            : DataLog LogReport : Resumable RpcError Rpc
            : Resumable RpcError (Responses RequestId Response)
            : Events (OutChan Event) Event
            : PScoped () (EventChan Event) (Consume Event) : Reports
            : Process RpcMessage (Either Text RpcMessage) : UserError : r)
         a)
-> Sem
     (Rpc
        : Log : DataLog LogReport : Resumable RpcError Rpc
        : Resumable RpcError (Responses RequestId Response)
        : Events (OutChan Event) Event
        : PScoped () (EventChan Event) (Consume Event) : Reports
        : Process RpcMessage (Either Text RpcMessage) : UserError : r)
     a
-> Sem r a
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
  Sem
  ((Handlers !! Report)
     : Log : DataLog LogReport : Resumable RpcError Rpc
     : Resumable RpcError (Responses RequestId Response)
     : Events (OutChan Event) Event
     : PScoped () (EventChan Event) (Consume Event) : Reports
     : Process RpcMessage (Either Text RpcMessage) : UserError : r)
  a
-> Sem
     (Log
        : DataLog LogReport : Resumable RpcError Rpc
        : Resumable RpcError (Responses RequestId Response)
        : Events (OutChan Event) Event
        : PScoped () (EventChan Event) (Consume Event) : Reports
        : Process RpcMessage (Either Text RpcMessage) : UserError : r)
     a
InterpreterFor (Handlers !! Report) (HostSocketStack ++ r)
handlers (Sem
   ((Handlers !! Report)
      : Log : DataLog LogReport : Resumable RpcError Rpc
      : Resumable RpcError (Responses RequestId Response)
      : Events (OutChan Event) Event
      : PScoped () (EventChan Event) (Consume Event) : Reports
      : Process RpcMessage (Either Text RpcMessage) : UserError : r)
   a
 -> Sem
      (Log
         : DataLog LogReport : Resumable RpcError Rpc
         : Resumable RpcError (Responses RequestId Response)
         : Events (OutChan Event) Event
         : PScoped () (EventChan Event) (Consume Event) : Reports
         : Process RpcMessage (Either Text RpcMessage) : UserError : r)
      a)
-> (Sem
      (Rpc
         : Log : DataLog LogReport : Resumable RpcError Rpc
         : Resumable RpcError (Responses RequestId Response)
         : Events (OutChan Event) Event
         : PScoped () (EventChan Event) (Consume Event) : Reports
         : Process RpcMessage (Either Text RpcMessage) : UserError : r)
      a
    -> Sem
         ((Handlers !! Report)
            : Log : DataLog LogReport : Resumable RpcError Rpc
            : Resumable RpcError (Responses RequestId Response)
            : Events (OutChan Event) Event
            : PScoped () (EventChan Event) (Consume Event) : Reports
            : Process RpcMessage (Either Text RpcMessage) : UserError : r)
         a)
-> Sem
     (Rpc
        : Log : DataLog LogReport : Resumable RpcError Rpc
        : Resumable RpcError (Responses RequestId Response)
        : Events (OutChan Event) Event
        : PScoped () (EventChan Event) (Consume Event) : Reports
        : Process RpcMessage (Either Text RpcMessage) : UserError : r)
     a
-> Sem
     (Log
        : DataLog LogReport : Resumable RpcError Rpc
        : Resumable RpcError (Responses RequestId Response)
        : Events (OutChan Event) Event
        : PScoped () (EventChan Event) (Consume Event) : Reports
        : Process RpcMessage (Either Text RpcMessage) : UserError : r)
     a
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
  Sem
  (Rpc
     : Host : (Handlers !! Report) : Log : DataLog LogReport
     : Resumable RpcError Rpc
     : Resumable RpcError (Responses RequestId Response)
     : Events (OutChan Event) Event
     : PScoped () (EventChan Event) (Consume Event) : Reports
     : Process RpcMessage (Either Text RpcMessage) : UserError : r)
  a
-> Sem
     ((Handlers !! Report)
        : Log : DataLog LogReport : Resumable RpcError Rpc
        : Resumable RpcError (Responses RequestId Response)
        : Events (OutChan Event) Event
        : PScoped () (EventChan Event) (Consume Event) : Reports
        : Process RpcMessage (Either Text RpcMessage) : UserError : r)
     a
forall er (r :: EffectRow).
Members (HostDeps er) r =>
InterpretersFor '[Rpc, Host] r
testHost (Sem
   (Rpc
      : Host : (Handlers !! Report) : Log : DataLog LogReport
      : Resumable RpcError Rpc
      : Resumable RpcError (Responses RequestId Response)
      : Events (OutChan Event) Event
      : PScoped () (EventChan Event) (Consume Event) : Reports
      : Process RpcMessage (Either Text RpcMessage) : UserError : r)
   a
 -> Sem
      ((Handlers !! Report)
         : Log : DataLog LogReport : Resumable RpcError Rpc
         : Resumable RpcError (Responses RequestId Response)
         : Events (OutChan Event) Event
         : PScoped () (EventChan Event) (Consume Event) : Reports
         : Process RpcMessage (Either Text RpcMessage) : UserError : r)
      a)
-> (Sem
      (Rpc
         : Log : DataLog LogReport : Resumable RpcError Rpc
         : Resumable RpcError (Responses RequestId Response)
         : Events (OutChan Event) Event
         : PScoped () (EventChan Event) (Consume Event) : Reports
         : Process RpcMessage (Either Text RpcMessage) : UserError : r)
      a
    -> Sem
         (Rpc
            : Host : (Handlers !! Report) : Log : DataLog LogReport
            : Resumable RpcError Rpc
            : Resumable RpcError (Responses RequestId Response)
            : Events (OutChan Event) Event
            : PScoped () (EventChan Event) (Consume Event) : Reports
            : Process RpcMessage (Either Text RpcMessage) : UserError : r)
         a)
-> Sem
     (Rpc
        : Log : DataLog LogReport : Resumable RpcError Rpc
        : Resumable RpcError (Responses RequestId Response)
        : Events (OutChan Event) Event
        : PScoped () (EventChan Event) (Consume Event) : Reports
        : Process RpcMessage (Either Text RpcMessage) : UserError : r)
     a
-> Sem
     ((Handlers !! Report)
        : Log : DataLog LogReport : Resumable RpcError Rpc
        : Resumable RpcError (Responses RequestId Response)
        : Events (OutChan Event) Event
        : PScoped () (EventChan Event) (Consume Event) : Reports
        : Process RpcMessage (Either Text RpcMessage) : UserError : r)
     a
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
  forall (index :: Nat) (inserted :: EffectRow) (head :: EffectRow)
       (oldTail :: EffectRow) (tail :: EffectRow) (old :: EffectRow)
       (full :: EffectRow) a.
(ListOfLength index head, WhenStuck index InsertAtUnprovidedIndex,
 old ~ Append head oldTail, tail ~ Append inserted oldTail,
 full ~ Append head tail,
 InsertAtIndex index head tail oldTail full inserted) =>
Sem old a -> Sem full a
insertAt @1

runHostSocket ::
  Members BasicStack r =>
  Member (Reader NvimSocket) r =>
  [RpcHandler (HostSocketStack ++ r)] ->
  InterpretersFor (Rpc : HostSocketStack) r
runHostSocket :: forall (r :: EffectRow).
(Members BasicStack r, Member (Reader NvimSocket) r) =>
[RpcHandler (HostSocketStack ++ r)]
-> InterpretersFor (Rpc : HostSocketStack) r
runHostSocket [RpcHandler (HostSocketStack ++ r)]
handlers =
  InterpreterFor (Handlers !! Report) (HostSocketStack ++ r)
-> InterpretersFor (Rpc : HostSocketStack) r
forall (r :: EffectRow).
(Members BasicStack r, Member (Reader NvimSocket) r) =>
InterpreterFor (Handlers !! Report) (HostSocketStack ++ r)
-> InterpretersFor (Rpc : HostSocketStack) r
testHostSocket ([RpcHandler
   (Log
      : DataLog LogReport : Resumable RpcError Rpc
      : Resumable RpcError (Responses RequestId Response)
      : Events (OutChan Event) Event
      : PScoped () (EventChan Event) (Consume Event) : Reports
      : Process RpcMessage (Either Text RpcMessage) : UserError : r)]
-> InterpreterFor
     (Handlers !! Report)
     (Log
        : DataLog LogReport : Resumable RpcError Rpc
        : Resumable RpcError (Responses RequestId Response)
        : Events (OutChan Event) Event
        : PScoped () (EventChan Event) (Consume Event) : Reports
        : Process RpcMessage (Either Text RpcMessage) : UserError : r)
forall (r :: EffectRow).
Members '[Resumable RpcError Rpc, Log, Error BootError] r =>
[RpcHandler r] -> InterpreterFor (Handlers !! Report) r
interpretHandlers [RpcHandler
   (Log
      : DataLog LogReport : Resumable RpcError Rpc
      : Resumable RpcError (Responses RequestId Response)
      : Events (OutChan Event) Event
      : PScoped () (EventChan Event) (Consume Event) : Reports
      : Process RpcMessage (Either Text RpcMessage) : UserError : r)]
[RpcHandler (HostSocketStack ++ r)]
handlers)

runHostSocket_ ::
  Members BasicStack r =>
  Member (Reader NvimSocket) r =>
  InterpretersFor (Rpc : HostSocketStack) r
runHostSocket_ :: forall (r :: EffectRow).
(Members BasicStack r, Member (Reader NvimSocket) r) =>
InterpretersFor (Rpc : HostSocketStack) r
runHostSocket_ =
  InterpreterFor (Handlers !! Report) (HostSocketStack ++ r)
-> InterpretersFor (Rpc : HostSocketStack) r
forall (r :: EffectRow).
(Members BasicStack r, Member (Reader NvimSocket) r) =>
InterpreterFor (Handlers !! Report) (HostSocketStack ++ r)
-> InterpretersFor (Rpc : HostSocketStack) r
testHostSocket forall (r :: EffectRow). InterpreterFor (Handlers !! Report) r
InterpreterFor (Handlers !! Report) (HostSocketStack ++ r)
interpretHandlersNull