def head_or_zero

mlbend-generative@0.1.1.0 · main.bend:376

import mlbend-generative@0.1.1.0/main.bend as MlbendGenerative
import Base

376# the head of a list, or 0.0 when it is empty: the missing eps or z of a
377# step whose z is not drawn at all (eta = 0 passes Nil, and sigma·0.0 is
378# 0.0)
379def head_or_zero(xs: List<&2, F32>) -> F32:
380  match xs:
381    case Nil{}:
382      0.0
383    case Con{h, t}:
384      h

Uses (2)

Used by (1)