|
|
|
|
|
by ykonstant
1020 days ago
|
|
Surely you can define such notation, but why? The following is just as clear and concise, and does not rely on any extensions: (. * 2) <$> [1,2,3]
For example: def byTwo (inputList : List Nat) :=
(. * 2) <$> inputList
#eval byTwo [1, 2, 3]
-- [2, 4, 6]
|
|
Why not? I was curious, Haskell is the functional language I know. Lean is the language I do not know.
Since Lean leans even heavier towards mathematics, set builder style notation seems like a natural fit. Now whether or not such notation is actually needed or worth it, that is a whole different question.