def hangul.lv

bend-kit-unicode@0.1.0.0 · unicode.bend:88

import bend-kit-unicode@0.1.0.0/unicode.bend as Unicode
import Base

88def hangul.lv(ok: Bool, +a: U32, +b: U32) -> Maybe<&2, U32>:
89  match ok:
90    case True{}:
91      Some{(44032 + ((((a - 4352) * 21) + (b - 4449)) * 28) : U32)}
92    case False{}:
93      +t = (b - 4519 : U32)
94      +s = (a - 44032 : U32)
95      hangul.lvt(Bool.and(Bool.and(U32.is_lt(s, 11172), U32.is_eq((s % 28 : U32), 0)), Bool.and(U32.is_lt(0, t), U32.is_lt(t, 28))), a, t)

Uses (11)

Used by (1)