lib+test: unify errors to Hare named-void tagged-union

Five tags from ref/hare/errors/common.ha — invalid, noaccess, noentry,
exists, unsupported — all !void. lib/io keeps eof/closed as plain void
(no Hare analogue for ww's singleton-style done) and adds underread.
Drops errors.equal/isnil and the old str-sentinel surface.
This commit is contained in:
2026-05-13 20:19:03 +09:00
parent 388ab8a707
commit 2243849855
4 changed files with 71 additions and 45 deletions

View File

@@ -40,8 +40,9 @@ export fn readbyte(b: *buf) (i32 | void) = {
// Distinct alias so `(str | linerr)` has two variant types the
// tagged-union machinery can keep apart at the tag level. The error
// variant carries a short description; callers compare with errors.equal
// or just inspect by length.
// variant carries a short description; callers inspect by length.
// Placeholder until bufio graduates to io.stream + named-void tags
// (eof / closed / underread).
type linerr = str;
// readline — Hare-style fallible line read (name transliterated from