def serve.stream.nonempty

bend-kit-http@0.38.5.0 · http.bend:6531

import bend-kit-http@0.38.5.0/http.bend as Http
import Base
import bend-kit-bytes@0.3.3.0/bytes.bend as Bytes

6531def serve.stream.nonempty(~S: Type, ~piece: S -> Bytes.Bytes -> IO(S & Bool), empty: Bool, state: S, b: Bytes.Bytes) -> IO(S & Bool):
6532  match empty:
6533    case True{}:
6534      IO.pure(S & Bool, (state, False{}))
6535    case False{}:
6536      piece(state, b)

Uses (6)

Used by (1)