Why is there an r in Data.List.unfoldr? Is it only for symmetry with foldr, or is there some other reason this unfolds should be considered to be right associative?
This came up when I was considering adding an unfold to Data.HashMap, where I couldn't think of a reason to include an r in the name. HashMaps have both right and left folds. I don't see a reason why the unfold would be more right than left.
In "The Underappreciated Unfold", where unfoldr is introduced, it is known as unfold (and foldr is fold, as you see here). However, by the time it made it into the List library, it had become unfoldr, as a dual to foldr.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With