Combining Bag/OrdList?

Jared Weakly jweakly at pdx.edu
Sat Jun 2 17:55:10 UTC 2018


> It looks to me like many of the applications of snocBag should really be
using OrdList.

Do you think there's benefit in refactoring to use ordList and then
removing snoc/cons from the bag API (instead providing only operations that
make no assumptions about ordering)?

Jared

On Sat, Jun 2, 2018, 10:39 AM Ben Gamari <ben at smart-cactus.org> wrote:

> Andreas Klebinger <klebinger.andreas at gmx.at> writes:
>
> >  > we are free to improve the implementation of Bag in the future so
> > that it doesn’t preserve order
> >
> > Imo we lost that ability by exposing consBag & snocBag which imply that
> > there is a front and a back.
> > Which at first glance also seem to be already used in GHC with that
> > behavior in mind.
> >
> It looks to me like many of the applications of snocBag should really be
> using OrdList.
>
> In my opinion we should keep the two types apart and simply be more
> careful about when we use each. There is value in being precise about
> whether or not ordering of a structure is relevant, even if we don't
> take advantage of this in the structure's representation.
>
> Cheers,
>
> - Ben
> _______________________________________________
> ghc-devs mailing list
> ghc-devs at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-devs/attachments/20180602/91b1810c/attachment.html>


More information about the ghc-devs mailing list