Commit graph

12 commits

Author SHA1 Message Date
Ruud van Asseldonk
3b7720940e Replace Int with Number in the docs
This is part of updating the implementation to have a single number type.
I have to admit, doing this, I'm hesitant again. I would really like len
functions to return Int, or to clarify in the types that std.range
accepts only integers. But let's experiment, implement this, and get a
feel for it before I make a call.
2025-02-24 20:42:59 +01:00
Ruud van Asseldonk
684efd8a9b Write and extend some docs on numbers
I thought I was close to having a finished design, but re-reading what
I wrote before ... there are still some loose ends, like the comparison
operator now behaving very unexpectedly. Maybe I should ban cross-value
comparisons after all, and move that to a different function?
2025-02-24 20:42:59 +01:00
Ruud van Asseldonk
5406c936ea Link to RCL blog post series from type system docs 2024-07-22 23:00:24 +02:00
Ruud van Asseldonk
c1847ccfb5 Document union types 2024-04-22 21:38:18 +02:00
Ruud van Asseldonk
b929a2fbcd Write some docs about type inference 2024-02-25 12:46:03 +01:00
Ruud van Asseldonk
c689237834 Document the Void type 2024-02-24 21:43:39 +01:00
Ruud van Asseldonk
4d3c8c6034 Document that the typechecker may reject programs
I was thinking about this, with my subtype relation. If I really want
"not (T < U)" to mean "every possible value of T is not an instance of
U", then "List[Int]" and "List[String]" might actually be compatible,
and I need a runtime check. But that misses the point of the type
system!

Also add one of these as a golden. I want the other one too, but I first
need to implement reporting nested type errors.
2024-02-24 21:43:39 +01:00
Ruud van Asseldonk
fa31336753 Rename "Dynamic" to "Any"
After going through the lattice exercise, and clarifying to myself what
that means, "dynamic" is now no longer a special type that gets treated
differently from the others (like it is, or at least looked to me, in C#
where I took the name from). It is just the type that describes all
possible values, and "Any" is a very good name for that. Also, the long
"Dynamic" was starting to annoy me because it's too long, and also, this
makes it consistent with Mypy.
2024-02-24 21:43:39 +01:00
Ruud van Asseldonk
ad8296c616 Document that record types are planned 2024-02-24 21:43:39 +01:00
Ruud van Asseldonk
866fa727e7 Allow writing naming the Dynamic type
It was an internal representation only, but there is no technical
reason to not let users refer to it, and in fact I already documented
it.

There is some room for bikeshed. Should it be written "Dynamic", or
"Dyn", or maybe even "_"? But for now I'll go with "Dynamic".
2024-02-24 21:43:39 +01:00
Ruud van Asseldonk
e3c4929de5 Manage expectations a bit in the docs 2024-01-30 22:14:19 +01:00
Ruud van Asseldonk
5fd4922b19 Document the new type system
This is also running ahead to the static type checks that I already
implemented on top of this branch, so the documentation does not reflect
so much the work preceding this commit, as the plans for how the type
system will work.
2024-01-30 22:14:19 +01:00