Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

First-class binary operations #139

Closed
13 tasks done
rolyp opened this issue May 17, 2019 · 1 comment
Closed
13 tasks done

First-class binary operations #139

rolyp opened this issue May 17, 2019 · 1 comment

Comments

@rolyp
Copy link
Collaborator

rolyp commented May 17, 2019

Given more regular treatment of primitives in #138 and #128, it would be easy now to allow first-class binary operations, perhaps using Haskell-style “section” syntax.

Doing this as part of the PureScript port and in particular #301. Will involve porting more of the TypeScript implementation, in particular the bits that deal with binary operations.

  • full Haskell-style section syntax – see comment below
  • BinaryOp datatype, binaryOps map from strings to operators
  • BinaryApp expression form
  • basic prettyprinting for BinaryApp
  • delete Typed?
  • BinaryApp trace form
  • delete Add form
  • Op expression and value forms
  • evaluation and forward-slicing rules for Op expressions
  • (op) to denote first-class operator
  • App to handle first-class operators as well as closures
  • forward-slicing rules for App/operator cases
  • Op form should take an operator name; eval rule should look this up in the environment
  • populate initial environment with an entry for each primitive
@rolyp
Copy link
Collaborator Author

rolyp commented May 12, 2020

Full Haskell-style section syntax, e.g. (3 * 4 +), would involve a non-trivial modification buildExprParser, which currently only supports trees of binary operations. Useful low-hanging fruit would be to allow (+) to denote the operator, which would allow putting expressions like (+) 5 and flip (+) 5 in the function position of an application.

@rolyp rolyp closed this as completed May 13, 2020
@rolyp rolyp reopened this May 14, 2020
@rolyp rolyp closed this as completed May 19, 2020
@rolyp rolyp added this to the v0.4: POPL 2022 milestone Nov 3, 2021
@rolyp rolyp added this to Fluid Jun 30, 2022
@rolyp rolyp moved this to Done in Fluid Jun 30, 2022
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
Status: Done
Development

No branches or pull requests

1 participant