def last

bend-collections-laws-math@1.0.0.0 · spec/lib/common.bend:97

import bend-collections-laws-math@1.0.0.0/spec/lib/common.bend as Common
import Base

97def last(-A: Data, xs: List<&2, A>) -> Maybe<&2, A>:
98  match xs:
99    case Nil{}:
100      None{}
101    case Con{h, t}:
102      match t:
103        case Nil{}:
104          Some{h}
105        case Con{h2, t2}:
106          last(A, Con{h2, t2})

Uses (2)

Used by (1)