From: Berke Durak <berke.durak@exalead.com>
To: David Allsopp <dra-news@metastack.com>
Cc: "'Brian Hurt'" <bhurt@janestcapital.com>,
"'Jon Harrop'" <jon@ffconsultancy.com>,
caml-list@yquem.inria.fr
Subject: Re: [Caml-list] Announce: xsetxmap, unfunctorized, Sexp-lib awareversions of Set and Map
Date: Wed, 23 Apr 2008 16:22:58 +0200 [thread overview]
Message-ID: <480F4642.20703@exalead.com> (raw)
In-Reply-To: <008b01c8a549$e6fa0600$017ca8c0@countertenor>
David Allsopp wrote:
> Brian Hurt wrote:
>
>> Jon Harrop wrote:
>>
>
> Agreed - then we could also have more sensibly located functions such as
> Int.of_string (note that it's the same length as int_of_string!!) and remove
> lots of random functions from Pervasives!
Of course we'll just add an extra Int module and leave Pervasives alone, or at
least make it trigger a warning.
> All that said, and especially as StdLib changes are reasonably rare, I find
> having files IntSet.ml and IntSet.mli containing:
>
> include Set.Make(struct type t = int let compare = Pervasives.compare end)
>
> and
>
> include Set.S with type elt = int
>
> isn't too bad (except that you have to include IntSet.cmo/.cmx when
> compiling, obviously)
>
>
I agree, and someone might write an optimized version for ints or floats.
But Xset & Xmap also provide opportunities to add some missing functions.
In particular, I often use Sets or Maps as a good priority queue/heap substitute, and
reverse_fold / reverse_iter come in handy.
The only problem is that I have an allergy to CamlCaseIdentifiers but I'll
just swallow some antiHistaminics.
--
Berke DURAK
next prev parent reply other threads:[~2008-04-23 14:23 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-21 9:39 Announce: xsetxmap, unfunctorized, Sexp-lib aware versions " Berke Durak
2008-04-21 10:59 ` [Caml-list] " Jean-Christophe Filliâtre
2008-04-21 11:19 ` Berke Durak
2008-04-23 12:35 ` Jon Harrop
2008-04-23 13:25 ` Brian Hurt
2008-04-23 13:56 ` [Caml-list] Announce: xsetxmap, unfunctorized, Sexp-lib awareversions " David Allsopp
2008-04-23 14:22 ` Berke Durak [this message]
2008-04-26 14:44 ` Alexandre Pilkiewicz
2008-04-23 13:41 ` [Caml-list] Announce: xsetxmap, unfunctorized, Sexp-lib aware versions " Berke Durak
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=480F4642.20703@exalead.com \
--to=berke.durak@exalead.com \
--cc=bhurt@janestcapital.com \
--cc=caml-list@yquem.inria.fr \
--cc=dra-news@metastack.com \
--cc=jon@ffconsultancy.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).