-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Treat types as compile-time expressions #132
Comments
I think this is a great direction to go. It allows abstraction of the type On Wed, Oct 1, 2014 at 8:21 PM, Jon Purdy notifications@github.com wrote:
|
So would types more or less follow the same syntax as expressions, like in Haskell? |
@dmbarbour A @bjz Yes, they would have exactly the same syntax, just a different set of operators. I would like a way to avoid requiring stack variables, because they would be on every function. We could have two different function arrows:
Or “type holes”:
Vectors were originally |
I believe I see a potential problem with this. There is an ambiguity if ever you support non-type template params (which I'd really like you to). The special syntax allows you to be clear that (forgive my C++ terms, I'm still adjusting) |
Types are currently parsed specially. It would be simpler and more consistent if they were treated as ordinary compile-time expressions, which happen to produce types for use by the typechecker. This would be a big step toward static metaprogramming. Thoughts on how to do this:
Stream@a
→a Stream
These@(a, b)
→a b These
T vector
instead of[T]
a, b
instead ofa b
s
instead ofs...
s, a -> s, a, a
instead ofa -> a a
a | b
can denote a sum type or a bitwise OR without dealing with overloading (yet (again))The text was updated successfully, but these errors were encountered: