Lyricdev
GitHub

LYR-MIG0601

a library function without a form

hint · spec 14-cli

A note of lyric fix --from-4: a function of Lyric 4's library has no form in Lyric 5, by decision: an optional has no functions, a Result has of and get.

Explanation

Some of Lyric 4's library has no counterpart in Lyric 5, on purpose. An optional is taken apart with if (let v = o) and ??, not with map(o, f). A Result is an enum with two bridges, Result.of and try r.get(), and is matched as any enum is. The call stays as written, and the note says what to write instead.

Example

by hand[LYR-MIG0601] main.lyr:5:13: 'map(o, f)' has no form in Lyric 5 — Lyric 5 has no function on an optional: 'if (let v = o) f(v) else null'