From: "Till Varoquaux" <till.varoquaux@gmail.com>
To: "Caml List" <caml-list@inria.fr>
Subject: Circuralizing lists
Date: Mon, 26 Nov 2007 16:46:22 -0500 [thread overview]
Message-ID: <9d3ec8300711261346r4b74f5gddce229324dcad2c@mail.gmail.com> (raw)
Writing the list containing an inifinite number of ones can easily be done as:
let rec ones = 1::ones
I however don't know of any type safe to generate the infinite list
which is the repetition of a given list (in a type safe non lazy way).
What I'm looking for is a code that would do:
let circularize = function
| [] -> failwith "cannot circularize empty lists"
| l -> let rec res = l@res in res
Is this at all possible?
Cheers,
Till
next reply other threads:[~2007-11-26 21:46 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-26 21:46 Till Varoquaux [this message]
2007-11-26 21:58 ` [Caml-list] " Alain Frisch
2007-11-26 22:41 ` Jon Harrop
2007-12-20 21:04 ` David Thomas
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=9d3ec8300711261346r4b74f5gddce229324dcad2c@mail.gmail.com \
--to=till.varoquaux@gmail.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