-
Notifications
You must be signed in to change notification settings - Fork 15
Open
Description
Related to #42 (comment) & #44
Is there a recommended approach for nesting a map? This would allow arbitrary nesting in a single point-free expression — something that's really difficult in languages I've explored.
For example, if we wanted to use @chain for the whole expression, it would currently look something like:
@chain "a|x\nb| y z " begin
strip
split("\n")
map(_) do x
@chain x begin
split("|")
map(_) do y
@chain y strip split
end
end
end
endBut the x and y aren't needed here! Assuming there isn't an existing recommended approach — could we extent Chain to handle those too, with feature for reducing map(_) do x; @chain x begin down to something like map @chain do, so we could have:
@chain "a|x\nb| y z " begin
strip
split("\n")
map @chain do
split("|")
map @chain do
strip
split
end
end
endI'm not sure of the exact form that's both concise and idiomatic — I don't have a view on the exact syntax. And feel free to say this is a bad idea... Thanks again.
Exr0n
Metadata
Metadata
Assignees
Labels
No labels