def among

ezx@1.11.0.0 · src/git/git.bend:58

import ezx@1.11.0.0/src/git/git.bend as Git
import Base

58# whether a char is one of these. Base has `Char.is_digit` and `Char.is_alpha`
59# and nothing between, and a commit name is written with neither alphabet but
60# with sixteen characters of its own, so the sixteen are named.
61def among(+ch: Char, cs: List<&2, Char>) -> Bool:
62  match cs:
63    case []:
64      False{}
65    case +h <> t:
66      among.step(Char.is_eq(h, ch), _u => among(ch, t))

Uses (5)

Used by (1)