From: Erik de Castro Lopo <mle+ocaml@mega-nerd.com>
To: caml-list@inria.fr
Subject: Re: [Caml-list] Memoization
Date: Sat, 9 Sep 2006 17:56:52 +1000 [thread overview]
Message-ID: <20060909175652.93b8d71d.mle+ocaml@mega-nerd.com> (raw)
In-Reply-To: <45023723.2050708@andrej.com>
Andrej Bauer wrote:
> I use the code below to show my students what can be done with
> higher-order functions. For a real implementation, we would have to use
> something more efficient than association lists (but then you might end
> up writing a polymorphic version of the Map module). Improvements are
> welcome.
Thanks Andrej, thats interesting. Is there any reason you didn't
use a Hashtbl instead of the association list? I don't really think
the the ordering of the Map module is needed.
The particular function I'm trying to memoize is a function of
two integers. I was hoping it might be possible to write a
memoize function that memoizes any function of a small arbitrary
number of parameters. Thinking about it some more I'm beginning
to this this is not possible.
Cheers,
Erik
--
+-----------------------------------------------------------+
Erik de Castro Lopo
+-----------------------------------------------------------+
Saying Python is easier than C++ is like saying that turning a
light switch on or off is easier than operating a nuclear reactor.
next prev parent reply other threads:[~2006-09-09 7:57 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-09-09 0:33 Memoization Erik de Castro Lopo
2006-09-09 3:38 ` [Caml-list] Memoization Andrej Bauer
2006-09-09 7:56 ` Erik de Castro Lopo [this message]
2006-09-09 15:47 ` Mike Lin
2006-09-09 21:20 ` William Neumann
2006-10-06 3:22 ` Walid Taha
2006-09-30 8:49 ` Jan Kybic
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=20060909175652.93b8d71d.mle+ocaml@mega-nerd.com \
--to=mle+ocaml@mega-nerd.com \
--cc=caml-list@inria.fr \
/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