Skip to content
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

Extend notation for Function_Thing #3515

Open
mahrud opened this issue Oct 14, 2024 · 0 comments
Open

Extend notation for Function_Thing #3515

mahrud opened this issue Oct 14, 2024 · 0 comments

Comments

@mahrud
Copy link
Member

mahrud commented Oct 14, 2024

Currently if f = (x,y) -> x+y then f_i is essentially y -> i+y:

Function _ Thing := Function => (f,x) -> y -> f splice (x,y)

I suggest we define some sort of simple notation to define:

f(i, _) == y -> i+y
f(_, j) == x -> x+j

It doesn't have to be this exact notation or necessarily involve _, but ideally something simple and clear that we're leaving an input blank and producing a function.

This is helpful for instance in defining a functor F = Hom(M, _).

Roughly speaking, I think the implementation would involve:

  1. when parsing a comma-separated sequence, if _ is seen, produce a special type of code, say InputSequence,
  2. define Function InputSequence to return a new function.

Another, probably much easier route is to define Function _ Sequence and allow f_(i, null) but that might cause confusion (e.g. what if the first input of f is supposed to be a sequence? or that one of the inputs is really supposed to be null?)

ps: tangentally related to #1630

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant