Core.nullable: def of bend-schema-lib@0.4.1.0 Import: import bend-schema-lib@0.4.1.0/core.bend as Core Lines 1718-1739 of bend-schema-lib@0.4.1.0/core.bend: https://jend.leeeet.dev/read.txt?path=bend-schema-lib@0.4.1.0/core.bend&start_line=1718&end_line=1739 import Base def nullable(s: Schema) -> Bool: match s: case SOpt{i}: True{} case SOptional{i}: True{} # absent and the inner's own null read as the same None case SRule{s2, tag}: nullable(s2) case SStrict{s2}: nullable(s2) case SStrLen{lo, hi, s2}: nullable(s2) case SListLen{lo, hi, s2}: nullable(s2) case STagged{k, n, cs, rest}: nullable(rest) case SVariant{n, vs, rest}: nullable(rest) case SEither{l, r}: Bool.or(nullable(l), nullable(r)) # a null would read as the inner's case _: False{} Uses (3): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.or https://jend.leeeet.dev/definition.txt?path=bend-schema-lib@0.4.1.0/core.bend&name=Schema