ws.bend fails
raw source on the hub · import 0xd66ee682d4ce8c656782ca9e0e4634cb/ws.bend as Ws
WebSocket RFC 6455 full-duplex in Bend.
Import as: import ./ws.bend as WS (from lib) or import ../../lib/ws.bend as WS (from tests/io). Reuses Base, HTTP, SHA1, B64 and the byte effects in lib/tcp.bend (TCP.send_bytes/TCP.recv_bytes).
Scope: server and client, text and binary frames, fragmentation, ping/pong/close. No TLS (same limit as HTTP.fetch). Frames ride TCP.send_bytes/TCP.recv_bytes, byte-faithful on List<U32>; the pure codec stays full binary on List<U32>. See DESIGN below.
Discipline (user-land Bend has no Base carve-out): - every callee is defined ABOVE its caller; only self-recursion. - match scrutinees are params or pattern-bound vars, never computed. - helpers above drivers are leaves: they never call back down.
5 imports
import Base import ./http.bend as HTTP import ./sha1.bend as SHA1 import ./b64.bend as B64 import ./tcp.bend as TCP
The reader could not load this file (at 0xd66ee682d4ce8c656782ca9e0e4634cb/http.bend:1828). What bend.ts says:
Error:
- expected : an unambiguous name (the alias TCP shadows TCP.recv_bytes)
- observed : '('
Location:
1827 | def fetch.recv8(sock: Socket, meth: String, acc: List<&2, U32>) -> IO(Result<&1, &1, U32 & String, String>):
1828>| IO.bind(Socket & Result<&1, &1, U32 & String, List<&2, U32>>, Result<&1, &1, U32 & String, String>, TCP.recv_bytes(sock, 8192), m => fetch.after8fn(meth, acc, m))
| ^
1829 |