Proposal for Data.Graph : Improve graph creation complexity when nodes have "consecutive" keys

Olivier S. olivier.sohn at gmail.com
Tue Apr 3 00:11:23 UTC 2018


2018-04-03 1:51 GMT+02:00 Ivan Lazar Miljenovic <ivan.miljenovic at gmail.com>:

> On 3 April 2018 at 09:24, Olivier S. <olivier.sohn at gmail.com> wrote:
> > So it seems using Data.IntMap would be a good compromise?
>
> IntMap only works if `node ~ Int`; otherwise we lose generality.
>

I was under the impression that we can replace [(node, key, [key])], by
IntMap (node, [Int]), node being anything we want. Is it not true?


>
> My preferences are:
>
> * A typeclass (unfortunately Foldable for a Map is only on the values,
> not on the Key; unless you provide a wrapper?)
> * Lists (despite the issues you've pointed out, people can always
> convert Maps, IntMaps, etc. to lists to convert those values to a
> Graph)
> * Map
>
> --
> Ivan Lazar Miljenovic
> Ivan.Miljenovic at gmail.com
> http://IvanMiljenovic.wordpress.com
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/libraries/attachments/20180403/48a54111/attachment.html>


More information about the Libraries mailing list