def internal_find_put

bend-mathlib@0.8.1.0 · list.bend:547

import bend-mathlib@0.8.1.0/list.bend as List
import Base

547# What List.find does with its head: Some{h} on a hit, else the rest (Base until 2.0.37 had it as List.find.put).
548def internal_find_put(-A: Data, h: A, r: Maybe<&2, A>, hit: Bool) -> Maybe<&2, A>:
549  match hit:
550    case False{}:
551      r
552    case True{}:
553      Some{h}

Uses (2)

Used by (4)