|
|
|
|
|
by well1912
2792 days ago
|
|
"Digging deeper into why this worked this way was interesting, but it's bed time, so I'm going to cut the scroll here."
I can very roughly intuit why this is-- the difference between the two Applicative instances the author noticed was that the shape of the first tree was being fitted into the second tree vs the shape of the second into the first. So if you "bind" the lefthand side of <* > first, its shape will be "fitted" to the righthand side, and if you do the opposite you get the second "fitted" to the first shape. I believe it's the same as iterating over the righthand side of <* > in its implementation first instead of the lefthand side like in their first, wrong implementation? But my reasoning feels loose here. I probably just need to look at their implementation of Monad Tree closer. :-) |
|