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 seq applied to a list will create sublists: [ 1 2 3 ] seq -> [ [ 1 ] [ 1 2 ] [ 1 2 3 ] ]
This is inconsistent because normally seq will just push multiple values onto the current stack without wrapping them in a group. But providing a flat list is not very useful: [ 1 1 2 1 2 3 ]. Also changing the number of list elements is unusual. Perhaps this can be seen as a case of cross-product and everything is OK.
What about applying a function to a list?
Should the list be bound as a parameter inside the function? This might be useful.
Should the function be applied to every parameter of the list? This might be useful, too.
Same thing with drop: Currently there is plain drop (d) which is treating lists in any way: It will just drop a list. To drop elements from inside a list, there is di (drop indirect). But there is currently no way to drop elements from inside multiple lists (dii? how many indirections do we need?), think of transforming [ [ 1 2 ] [ 3 4 ] [ 5 6 ] ] into [ [ 2 ] [ 4 ] [ 6 ] ].
Perhaps we need explicit map and flatMap operations that tie in together with other operations and remove the explicit list handling currently hardcoded to every (well, at least some) operation? This might also help with deduping the list handling parts in the code (see #3).
The text was updated successfully, but these errors were encountered:
Currently
seq
applied to a list will create sublists:[ 1 2 3 ] seq
->[ [ 1 ] [ 1 2 ] [ 1 2 3 ] ]
This is inconsistent because normally
seq
will just push multiple values onto the current stack without wrapping them in a group. But providing a flat list is not very useful:[ 1 1 2 1 2 3 ]
. Also changing the number of list elements is unusual. Perhaps this can be seen as a case of cross-product and everything is OK.What about applying a function to a list?
Same thing with drop: Currently there is plain drop (
d
) which is treating lists in any way: It will just drop a list. To drop elements from inside a list, there isdi
(drop indirect). But there is currently no way to drop elements from inside multiple lists (dii
? how many indirections do we need?), think of transforming[ [ 1 2 ] [ 3 4 ] [ 5 6 ] ]
into[ [ 2 ] [ 4 ] [ 6 ] ]
.Perhaps we need explicit
map
andflatMap
operations that tie in together with other operations and remove the explicit list handling currently hardcoded to every (well, at least some) operation? This might also help with deduping the list handling parts in the code (see #3).The text was updated successfully, but these errors were encountered: