ref: caa2cd99e469f598d19a03f2ba4d3c23c6e9d6f5
dir: /lib/std/diriter.myr/
use "alloc"
use "dir"
use "option"
pkg std =
type diriter = dir#
impl iterable diriter -> byte[:]
const byentry : (d : dir# -> diriter)
;;
const byentry = {d
-> d castto(diriter)
}
impl iterable diriter -> byte[:] =
__iternext__ = {itp, valp
match dirread(itp# castto(dir#))
| `Some ent:
valp# = ent
-> true
| `None:
-> false
;;
}
__iterfin__ = {itp, valp
std.slfree(valp#)
}
;;