From: Sylvain Pogodalla <Sylvain.Pogodalla@xrce.xerox.com>
To: Terrence Brannon <princepawn@earthlink.net>, caml-list@inria.fr
Subject: Re: [Caml-list] converting a list to a Stream
Date: Sat, 12 May 2001 17:31:26 +0200 [thread overview]
Message-ID: <3AFD574E.E5CCECFC@xrce.xerox.com> (raw)
In-Reply-To: <15101.21254.203779.784643@gargle.gargle.HOWL>
Terrence Brannon wrote:
>
> How does one convert a list to a stream?
>
> # let c = [1; 2; 3 ];;
> val c : int list = [1; 2; 3]
> # Stream_of_list c;;
> Characters 0-16:
> Unbound constructor Stream_of_list
> # stream_of_list c;;
> Characters 0-14:
> Unbound value stream_of_list
To use a function defined for a module, you call it with the syntax :
Module.function arg
Here, you have :
# let l=[1; 2; 3 ];;
val l : int list = [1; 2; 3]
# Stream.of_list l;;
- : int Stream.t = <abstr>
Or, if you don't want to have to prefix the function with the module
name, you can open it :
# open Stream;;
# let l=[1; 2; 3 ];;
val l : int list = [1; 2; 3]
# of_list l;;
S.
-------------------
To unsubscribe, mail caml-list-request@inria.fr. Archives: http://caml.inria.fr
next prev parent reply other threads:[~2001-05-12 15:33 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-05-12 5:52 [Caml-list] recursive variants Miles Egan
2001-05-12 15:13 ` [Caml-list] converting a list to a Stream Terrence Brannon
2001-05-12 15:31 ` Sylvain Pogodalla [this message]
2001-05-12 15:35 ` Didier Le Botlan
[not found] ` <3AFCFB23.CB503721@tsc.uc3m.es>
2001-05-12 15:28 ` [Caml-list] recursive variants Miles Egan
2001-05-12 15:35 ` Sven LUTHER
2001-05-12 21:49 ` Miles Egan
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=3AFD574E.E5CCECFC@xrce.xerox.com \
--to=sylvain.pogodalla@xrce.xerox.com \
--cc=caml-list@inria.fr \
--cc=princepawn@earthlink.net \
/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