You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
when parsing a comma-separated sequence, if _ is seen, produce a special type of code, say InputSequence,
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?)
Currently if
f = (x,y) -> x+y
thenf_i
is essentiallyy -> i+y
:I suggest we define some sort of simple notation to define:
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:
_
is seen, produce a special type of code, sayInputSequence
,Function InputSequence
to return a new function.Another, probably much easier route is to define
Function _ Sequence
and allowf_(i, null)
but that might cause confusion (e.g. what if the first input off
is supposed to be a sequence? or that one of the inputs is really supposed to benull
?)ps: tangentally related to #1630
The text was updated successfully, but these errors were encountered: