Server.answer: def of gralha-http-server@0.1.0.0 Import: import gralha-http-server@0.1.0.0/server.bend as Server Lines 81-92 of gralha-http-server@0.1.0.0/server.bend: https://jend.leeeet.dev/read.txt?path=gralha-http-server@0.1.0.0/server.bend&start_line=81&end_line=92 import Base import gralha-http-core@0.1.0.0/http.bend as Http def answer(~S: Type, ~handle: Http.Request -> S -> IO(S & Http.Response), got: Socket & Maybe<&2, Http.Request>, state: S) -> IO(S): (socket, request) = got match request: case None{}: do IO: Unit <- send(socket, Http.status(400)) return state case Some{r}: do IO: out : S & Http.Response <- handle(r)(state) answer.sent(S, socket, out) Uses (13): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=IO https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=IO.bind https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=IO.pure https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Maybe https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Pair https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Sigma https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Socket https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Unit https://jend.leeeet.dev/definition.txt?path=gralha-http-core@0.1.0.0/http.bend&name=Request https://jend.leeeet.dev/definition.txt?path=gralha-http-core@0.1.0.0/http.bend&name=Response https://jend.leeeet.dev/definition.txt?path=gralha-http-core@0.1.0.0/http.bend&name=status https://jend.leeeet.dev/definition.txt?path=gralha-http-server@0.1.0.0/server.bend&name=answer.sent https://jend.leeeet.dev/definition.txt?path=gralha-http-server@0.1.0.0/server.bend&name=send