
On 19-12-2014 19:02, David Feuer wrote:
All right! It's taken a long time, but I finally managed to write a nice implementation of `<*>` for `Data.Sequence`! It looks nothing like my original concept, but it accomplishes my incremental performance goals while also being a little better than the current implementation when forcing the whole result. Anyone interested can see the code in the `ap` branch of treeowl/containers on GitHub. There are still some ugly special cases for sufficiently small arguments--any ideas for changing that would be most welcome.
Link for the lazy like me: https://github.com/treeowl/containers/compare/ap
Many thanks to Joachim Breitner for helping implement an earlier approach, to Ross Paterson for coming up with a solution to a previous formulation of the problem (thus helping me understand that I had asked the wrong question), and to Carter Schonwald for putting up with my stream of consciousness rambling.
Nice work! I've got some questions/suggestions: - It would be nice to have at least one comment explaining the decisions surrounding the code and how it works. I read it without previous knowledge about how it would accomplish its goal and it was a bit painful. It's pretty clever code! - Why is ap3FT the only of the ap*FT family that cares about length fs < 2? - Why have the ap* family of functions instead of just deconstructing fs and wrapping Seq on apShort? Cheers! -- Felipe.