[Haskell-cafe] Reducing code for efficient ShowS

Sean Leather leather at cs.uu.nl
Fri Sep 5 19:09:55 EDT 2008


> > That's an interesting idea. It appears to use the same idea as ShowS, but
> > more generally with lists and not just strings.
>
> The difference-list approach to solving the appending problem is classic.
> There's a variant for unification-based logic languages as well. Both are
> functional takes on the imperative approach of keeping a tail pointer.
> Dons just took the time to package it up for us all :)
>

Yes, I've seen it before in UU.DData.Seq. Though, where it was that I
originally found it, I don't remember, but it wasn't the uulib. I didn't
know what a "difference list" was, so I didn't pay much attention when Don
released it.

http://hackage.haskell.org/packages/archive/uulib/0.9.5/doc/html/UU-DData-Seq.html

If you're planning on releasing the code, I'd suggest a different spelling
> of (.+.) though. The (.X.) pattern for a family of operators is pretty
> common, so it's good to avoid it for modules that want to be used in
> combination with many others. YMMV and all that.
>

That sounds reasonable. My only motivations were to keep the operators
short, sweet, and somewhat representative. Any suggestions are welcome.

Sean
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20080906/8530e5c1/attachment.htm


More information about the Haskell-Cafe mailing list