def serve.stream.nonempty

bend-kit-http@0.38.2.0 · http.bend:6539

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

6539def serve.stream.nonempty(~S: Type, ~piece: S -> Bytes.Bytes -> IO(S & Bool), empty: Bool, state: S, b: Bytes.Bytes) -> IO(S & Bool):
6540  match empty:
6541    case True{}:
6542      IO.pure(S & Bool, (state, False{}))
6543    case False{}:
6544      piece(state, b)

Uses (6)

Used by (1)