def time.wd.bits
import ezsys@0.1.0.0/src/clock.bend as Clockimport Base
292# the day of the week a word's value in days after a Monday, one bit at a
293# time from the lowest: the value is the bit plus twice the rest's
294def time.wd.bits(len: Nat, word: Word(len)) -> Wd:
295 match len:
296 case 0n:
297 Mon{}
298 case 1n+more:
299 match word:
300 case WCon{False{}, rest}:
301 +off = time.wd.bits(more, rest)
302 time.wd.plus(off, off)
303 case WCon{True{}, rest}:
304 +off = time.wd.bits(more, rest)
305 time.wd.next(time.wd.plus(off, off))