def odds

bend-mathlib@0.8.1.0 · perm.bend:201

import bend-mathlib@0.8.1.0/perm.bend as Perm
import Base

201# The elements of a list at odd positions (1, 3, 5, ...).
202def odds(-A: Data, xs: List<&2, A>) -> List<&2, A>:
203  match xs:
204    case Nil{}:
205      Nil{}
206    case +x <> r:
207      match r:
208        case Nil{}:
209          Nil{}
210        case +y <> t:
211          y <> odds(A, t)

Uses (1)

Used by (5)