def memn

bend-collections-laws-crypto@1.0.0.0 · spec/lib/common.bend:172

import bend-collections-laws-crypto@1.0.0.0/spec/lib/common.bend as Common
import Base

172# membership of a natural number in a list of them
173def memn(+s: Nat, xs: List<&2, Nat>) -> Bool:
174  match xs:
175    case Nil{}:
176      False{}
177    case Con{+x, t}:
178      Bool.or(Nat.is_eq(x, s), memn(s, t))

Uses (5)

Used by (0)

No other definition uses this definition.