aeson and dlist in HP 2013.4.0.0

Joachim Breitner mail at joachim-breitner.de
Mon Nov 18 09:21:44 UTC 2013


Hi,

Am Montag, den 18.11.2013, 10:04 +0200 schrieb Sean Leather:
> * Maintenance and development taken over by Sean Leather
> * Migrate repository from http://code.haskell.org/~dons/code/dlist/ to
>   https://github.com/spl/dlist
> * Add `Eq`, `Ord`, `Read`, `Show`, `Alternative`, `Foldable`, `Traversable`
>   instances

Given that the point of dlist is to speed up code where lists are
insufficient, would it make sense to only provide those instances that
can be implemented without converting to and from lists?

If there are instances that cannot be implemented idiomatically with
dlists, maybe they should be left out, to signal the user that he will
not get the benefits of DLists for these.

In particular, it seems that the Show instance could be improved.
Currently it says
          showsPrec p dl = showParen (p > 10) $
            showString "fromList " . shows (toList dl)
i.e. goes via a list. But this is constructing a ShowS (which is String
-> String) value, i.e. another difference list. Shouldn’t it be possible
to stay in the world of difference lists when implementing this?

(Or maybe I’m overly worried, and I admit that I did not run benchmarks
so far.)

Greetings,
Joachim

-- 
Joachim “nomeata” Breitner
  mail at joachim-breitner.dehttp://www.joachim-breitner.de/
  Jabber: nomeata at joachim-breitner.de  • GPG-Key: 0x4743206C
  Debian Developer: nomeata at debian.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <http://www.haskell.org/pipermail/libraries/attachments/20131118/1685a19c/attachment.sig>


More information about the Libraries mailing list