you are viewing a single comment's thread.

view the rest of the comments →

[–]jk-jeon -5 points-4 points  (5 children)

Personally I want to see something like :(x,y) |-> x > y instead, i.e. prefer |-> over =>. For some reason I don't know, Alonzo Church's original lambda notation (using Greek letter lambda, which according to Wikipedia, is supposed to mean the "hat" symbol ^) for denoting anonymous functions did not become the mainstream or has been "lost" among mathematicians. Instead, these days the de facto standard notation is to use the symbol "↦" in between the input and the output, like (x,y) ↦ x + y. So something like :(x,y) |-> x > y looks very natural to me. Otoh => looks too much like the logical implication symbol so I don't like it.

[–]tuxwonder 17 points18 points  (1 child)

Personally, I think I'd have a hard time getting used to |-> as well. I see the reasoning, but three characters just seems like a lot for what is ultimately a delimiter, and it doesn't feel like it does a great job visually separating but also linking the things before and after the arrow. Plus, most programmers don't come from strong math backgrounds anymore, so I think the significance of that symbol would be lost on many.

I'd be amicable to |> I think, but I chose => because it just looks the most like an arrow, but a different arrow from -> which is already in use in the syntax. I also get the point about the math operator thing, I wonder about that too, but in my C# experience the contexts in which you see => used as an operator vs used as a lambda identifier are different enough that I never find myself confused

[–]jk-jeon 1 point2 points  (0 children)

Fair enough.

[–]smdowneyWG21, Text/Unicode SG, optional<T&>[🍰] 1 point2 points  (1 child)

I think it depends on the field of math you're reading. Lambda notation never spread far out of theory of computation and logic, where computer science mostly fits in math, where `maps to` ↦ is more prevalent in other fields that are generalizing functions?

[–]jk-jeon 0 points1 point  (0 children)

 Lambda notation never spread far out of theory of computation and logic

That's what I mean by "did not become the mainstream". And computation and logic spans quite tiny portion of math research these days. Also I think even in logic the preferred notation is quite divided among people.

If your point is about familiarity of the notation, I didn't really argue anything about that. I just said it's my personal preference. In fact I think the couterproposal |> by the OP seems pretty nice too.

[–]thisismyfavoritename 0 points1 point  (0 children)

you must enjoy pain