-
-
Notifications
You must be signed in to change notification settings - Fork 3
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
pyret-for
- a new way to call higher order functions
#11
Comments
Great idea! I really like how small the macro is. I wonder if we can think of a clearer name. I like that
|
I'm not sure what "polydot" means.
|
Oh, "polydot" is the local name for the polymorphic dotted ( Anyway, I was thinking that polydot-typed functions have something in common that makes them fit well with But looking back at your original message, I see that [1] Practical Variable Arity Polymorphism. ESOP 2009 |
Today I explained this
I like The other (non- |
Like this?
|
Ah! I didn't mean to make you implement it --- I thought we were just talking about possibilities. That's awful about fold. I guess I'd want
😞 |
Actually, my version above also has a bug. I should check |
Many common higher-order functions consume a function value as the first argument, and
n
more arguments after that, where the function value acceptsn
arguments, which corresponds to the arguments in the call in some way. Examples include:map
,filter
(only one argument),andmap
,ormap
(foldl
andfoldr
have arguments in a wrong order, so they don't quite work)Example code without
pyret-for
The problem is that
Example code with
pyret-for
The
pyret-for
syntax, based on Pyret'sfor
, can be used to invoke this kind of higher-order functions.pyret-for
additionally improves upon Pyret'sfor
by allowing arbitrarymatch
pattern.Macro
Licence
MIT License / CC BY 4.0
The text was updated successfully, but these errors were encountered: