def json_of_maybe

mlbend-huggingface@0.1.1.0 · main.bend:70

import mlbend-huggingface@0.1.1.0/main.bend as MlbendHuggingface
import Base
import bend-kit-json@0.6.1.1/json.bend as Json

70# The JSON of a parsed body.
71def json_of_maybe(m: Maybe<&1, Json.Val>) -> Result<&1, &1, Err, Json.Val>:
72  match m:
73    case Some{v}:
74      Done{v}
75    case None{}:
76      Fail{ErrJson{}}

Uses (4)

Used by (1)