Yeti compiler now uses typedefs to make types shown simpler - if part of
type matches a typedef available in current scope, it will show the
typedef name (with parameters) there instead of the full type. This should
help a bit with those stupidly long error messages that tend to be given
when there are nested structure/variant types.
You need latest yeti.jar, of course (and please report bugs as usual). ;)
Additionally complex module type signatures show by yeti -type module.yeti
are much more readable now (when the module defines typedefs). This
should help with the documentation generator (actually implementing
typedefs in type pretty-printing got started for this reason).
This works also in REPL, and it also allows to show the full type
description by writing typedef name followed by is:
> readFile
<yeti.lang.io$readFile> is string -> string -> (input_handle -> 'a) -> 'a
> readFile 'test' '' do f: f.write 'what' done
1:28: input_handle does not have .write field
> input_handle is
{
close is () -> (),
contents is () -> string,
lines is () -> list<string>,
rawClose is () -> (),
read is number -> string,
readln is () -> string
}
The input_handle here is a typedef from yeti.lang.io standard module.
This affects only how types are shown, the structural typing still works
exactly like it has been previously.
Unfortunately defining new typedefs in REPL is still in TODO list, but
well, not everything can be done at once. ;)