Missing application of snd inside `indexedTree`
Closed this issue · 5 comments
unlocked2412 commented
Lines 1951 to 1961 in 5e84ff4
unlocked2412 commented
First issue I am opening. Seems very convenient :-)
RobTrew commented
Thanks ! I've added an index into the tuple.
unlocked2412 commented
Good. However, it doesn't return a type Tree (a, Int)
, yet. This function:
mapAccumLTree(
i => x => [1 + i, [x, {
index: i
}]]
)(rootIndex)
returns
(Traversable t, Enum b, Num b) => t a -> (b, t (a, b))
so, getting the second component of that type results in a type error, I think.
I might suggest composing snd
and mapAccumLTree
.
RobTrew commented
Thanks ! eta-expanded now.
(Always hubris to edit without testing – I must try to learn that :-))
unlocked2412 commented
Works perfectly ! Closing the issue :-)