[Haskell-cafe] <*> for Data.Sequence: mission accomplished

Felipe Lessa felipe.lessa at gmail.com
Sat Dec 20 00:01:38 UTC 2014


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.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20141219/d22ca906/attachment.sig>


More information about the Haskell-Cafe mailing list