Proposal: add nubOrd somewhere in containers

Elliot Cameron eacameron at gmail.com
Fri Oct 20 14:20:19 UTC 2017


That's also consistent with the commonly used "extra" package:
https://hackage.haskell.org/package/extra-1.6/docs/Data-List-Extra.html#v:nubOrd

On Fri, Oct 20, 2017 at 10:14 AM, Joachim Breitner <mail at joachim-breitner.de
> wrote:

> Hi,
>
> Am Mittwoch, den 18.10.2017, 13:49 -0400 schrieb David Feuer:
> > I am convinced that we should add
> >
> > ordNub :: Ord a => [a] -> [a]
> > ordNubOn :: Ord b => (a -> b) -> [a] -> [b]
> > intNub :: [Int] -> [Int]
> > intNubOn :: (a -> Int) -> [a] -> [a]
>
> can we shed the names a bit? I think the operation “nubbing” should be
> first, and the details (”…On”, “…By”, “…OrdOn”, “Ord”, “Int”) should be
> the second component. This would also have the advantage of listing all
> ”nub” variants together in an index.
>
> So:
>
> nubOrd   :: Ord a => [a] -> [a]
> nubOrdOn :: Ord b => (a -> b) -> [a] -> [b]
> nubInt   :: [Int] -> [Int]
> nubIntOn :: (a -> Int) -> [a] -> [a]
>
> This is consistent with, say “map” vs. “mapM” and other suffix-based
> naming in the libraries.
>
>
> Greetings,
> Joachim
> --
> Joachim Breitner
>   mail at joachim-breitner.de
>   http://www.joachim-breitner.de/
>
> _______________________________________________
> Libraries mailing list
> Libraries at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/libraries/attachments/20171020/98dc1b97/attachment.html>


More information about the Libraries mailing list