From: Brian Hurt <bhurt@janestcapital.com>
To: Jon Harrop <jon@ffconsultancy.com>
Cc: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] Announce: xsetxmap, unfunctorized, Sexp-lib aware versions of Set and Map
Date: Wed, 23 Apr 2008 09:25:43 -0400 [thread overview]
Message-ID: <480F38D7.4050503@janestcapital.com> (raw)
In-Reply-To: <200804231335.25708.jon@ffconsultancy.com>
Jon Harrop wrote:
>Actually I would say that your style is more useful than the built-in Set and
>Map modules because you don't have to jump through hoops defining your
>own "Int" module with its own "int" type and its own comparison function over
>ints every time you want a set of integers. I would put the comparison
>function in the set itself though.
>
>
>
IMHO, the Int module should be in the standard library, and the Set and
Map modules should have already instantiated sets and maps for the
standard base types (int, float, string, char).
Also, I'm not as down on functors as a lot of programmers seem to be.
While not perfect, they solve a number of problems very well. For
example, there are a number of operations on sets and maps which are
O(N) if and only if you know the two trees are in the same order, but
O(N log N) if you don't know they're in the same order. Functors lift
this check into the type system.
Brian
next prev parent reply other threads:[~2008-04-23 13:25 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-21 9:39 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 [this message]
2008-04-23 13:56 ` [Caml-list] Announce: xsetxmap, unfunctorized, Sexp-lib awareversions " David Allsopp
2008-04-23 14:22 ` Berke Durak
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=480F38D7.4050503@janestcapital.com \
--to=bhurt@janestcapital.com \
--cc=caml-list@yquem.inria.fr \
--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).