Replies: 1 comment 2 replies
-
|
Hey! I'm happy you like the language! And fun stuff you're trying in it :D This has actually come up and I've spent some time thinking about how to add it. It has a bunch of potential use-cases. The syntax that you used in your post unfortunately couldn't work, that's because Here's a syntax that I was envisioning: The I'd love to see this feature in the language, as it has more use-cases. But I also wonder how it would affect subtyping checking, it would definitely complicate it, but I wonder how much. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi! Newbie here!
First and foremost, love the language! Love the idea of a language that rules out deadlocks and is massively parallel.
I have been trying out things in the playground, primarily wanted to recreate Contexts from another research language I like, Koka.
Essentially a Context is a value with a hole in it, and you can iteratively refine the hole until you can fill it completely and obtain a finished value.
This is useful to abstract away and optimize iteration through lists, for example, to build a value "from the inside", to avoid reversing the list when you're done.
Now while this can be implemented natively, I just wanted to recreate the functionality in par for funsies.
Now, the type of this hole can change over each iteration, so with that context out of the way, this is the type I tried to express, in pseudo-par.
Thus a process on the other side of the Context would take the final fill, and apply the obtained functions in reverse order to get the filled out value.
Now, this is invalid code. In particular, this application of types to a
selfappears to be invalid.I was wondering, is there a way to do these "polymorphic iterative types"?
Would this or equivalent functionality be considered for addition?
Beta Was this translation helpful? Give feedback.
All reactions