def two_head

bend-collections@1.0.0.0 · src/containers/internal/intrusive_list.bend:120

import bend-collections@1.0.0.0/src/containers/internal/intrusive_list.bend as IntrusiveList
import Base

120def two_head(~S: Type, ~N: Data, ~next: S -> N -> S & Maybe<&2, N>, s: S, +head: Maybe<&2, N>) -> S & Bool:
121  match head:
122    case None{}: (s, False{})
123    case Some{n}: nonempty_result(~S, ~N, next(s, n))

Uses (5)

Used by (1)