Hello @DrBoolean,
I am a new-comer to FP and have watched all your videos to be able to start using it.
So currently we don't have access to index of element in List().traverse() method. Can you add it?
Basically, from
List([1,2]).traverse(Task.of, (ele) => Task.of(ele))
to List([1,2]).traverse(Task.of, (ele, index) => Task.of(ele))
workaround for now (but it may not be ideal for each situation): List([1,2]).toMap().traverse(Task.of, (ele, index) => Task.of(ele))
So index becomes the key if we use toMap()
Also, you can take a look at other methods to make sure we have access to the index, if possible.
I hope it is something that is easy for you to implement.
Hello @DrBoolean, I am a new-comer to FP and have watched all your videos to be able to start using it.
So currently we don't have access to index of element in
List().traverse()
method. Can you add it?Basically, from
List([1,2]).traverse(Task.of, (ele) => Task.of(ele))
to
List([1,2]).traverse(Task.of, (ele, index) => Task.of(ele))
workaround for now (but it may not be ideal for each situation):
List([1,2]).toMap().traverse(Task.of, (ele, index) => Task.of(ele))
So index becomes the key if we use
toMap()
Also, you can take a look at other methods to make sure we have access to the index, if possible.
I hope it is something that is easy for you to implement.