bolt/lsp/transport/service.bend checks
raw source on the hub · import 0x729eecea86ea5a2cdba3a2856a313bca/bolt/lsp/transport/service.bend as Service
transport: an effect service: one message body in, one out. H is the implementation's handle state; it is affine, so every call hands it back.
1 import
import Base
Types
type Transport source · line 7 · raw
@-H:Type -> Type
effect service over a handle H: receive a body, send a body, each handing the handle back
Transport@-H:Type -> @recv:(@_:H -> IO(Pair(H, Maybe<&2, String>))) -> @send:(@_:H -> @_:String -> IO(H)) -> Transport<H>
Definitions
def recv source · line 11 · raw
@-H:Type -> @t:Transport<H> -> @h:H -> IO(Pair(H, Maybe<&2, String>))
the next message's body; None when the peer is gone
def send source · line 16 · raw
@-H:Type -> @t:Transport<H> -> @h:H -> @body:String -> IO(H)
a body, through a transport