def Period.from.y
import bend-time-lib@0.4.0.1/period.bend as Periodimport Base
10def Period.from.y(
11 +years: U32, +extra: U32, +months: U32, +days: U32, ok: Bool
12) -> Result<&2, &2, Period.Error, Period>:
13 match ok:
14 case False{}:
15 Fail{OutOfRange{}}
16 case True{}:
17 Done{Period{U32.add(years, extra), months, days}}