From: Bruno Verlyck <Bruno.Verlyck@inria.fr>
From: Bruno.Verlyck@inria.fr
To: Tom Wilkie <tom@acunu.com>
Cc: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] Queue.fold give wrong order?
Date: Tue, 19 Jan 2010 16:53:55 +0100 [thread overview]
Message-ID: <201001191553.o0JFrtqh025899@waco.inria.fr> (raw)
In-Reply-To: "tom@acunu.com"'s message of Tue, 19 Jan 2010 15:10:43 +0000
Hi,
From: Tom Wilkie <tom@acunu.com>
Date: Tue, 19 Jan 2010 15:10:43 +0000
> Is Queue.fold going over items in the wrong order? It says "equivalent to
> List.fold_left" but I would expect the behaviour to be, when inserting items 1,
> then 2, then 3 a fold would be given items in that order?
It's already the case.
> # Queue.fold (fun acc a -> a::acc) [] q;;
> - : int list = [3; 2; 1]
Your (fun acc a -> a::acc) is first called with args [] and 1, and
yields a next value for accu of [1]; and so on.
HTH,
Bruno.
next reply other threads:[~2010-01-19 15:53 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-19 15:53 Bruno Verlyck, Bruno.Verlyck [this message]
-- strict thread matches above, loose matches on Subject: below --
2010-01-19 15:10 Tom Wilkie
2010-01-19 15:22 ` [Caml-list] " David Allsopp
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=201001191553.o0JFrtqh025899@waco.inria.fr \
--to=bruno.verlyck@inria.fr \
--cc=caml-list@yquem.inria.fr \
--cc=tom@acunu.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