caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: John Max Skaller <skaller@maxtal.com.au>
To: Francis Dupont <Francis.Dupont@enst-bretagne.fr>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] real lazy?
Date: Wed, 22 Aug 2001 11:54:16 +1000	[thread overview]
Message-ID: <3B8310C8.4B09F8E1@maxtal.com.au> (raw)
In-Reply-To: <200108211337.f7LDbGl36930@givry.rennes.enst-bretagne.fr>

Francis Dupont wrote:
> 
> I've got Chris Okasaki's "Purely Functional Data Structures"
> (a very nice book). Of course, I've tried to program the examples
> (I needed some training with functors :-) and I've found some
> issues:
>  - no recursion in modules (1) but I don't complain because
>    this cannot (should not!) be done

	It can be done with suitable constraints.
Intermodule function calling is no problem in Felix!
Nor is intermodule type dependence, provided
the types aren't mutually recursive,
and even that works provided there is an 'object boundary'
in the way such a union of variants.

	In fact, ALL definitions in Felix
at the same scope are mutually recursive.
You have to work hard to get a linear ordering!

[Getting 'open' to work at the same scope as the
module it opens was some fun!]

> PS: more:
> 
> 1- recursion in modules:
>  module A = struct type t = C of B.tt ... end
>  module B = Make(A)
> where Make is a functor. A uses B which is built from A.

	Agree: the Felix equivalent won't work either.
But it tries, and reports an error: not all intermodule
recursions are unsound (not all sound ones are admitted,
but some of them are, including function calling).

	Interestingly: Felix applies functors
in a trivial way that permits recursion into functor
instances where the corresponding intermodule 
recursion is also allowed: the functor instance
is constructed 'on demand' rather than wholistically.

	What is not permitted
is an interface recursion, since matching interfaces
to modules is done wholistically (even when the
interface/module component pair isn't used).

-- 
John (Max) Skaller, mailto:skaller@maxtal.com.au 
10/1 Toxteth Rd Glebe NSW 2037 Australia voice: 61-2-9660-0850
New generation programming language Felix  http://felix.sourceforge.net
Literate Programming tool Interscript     
http://Interscript.sourceforge.net
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


  parent reply	other threads:[~2001-08-22  1:54 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-08-21 13:37 Francis Dupont
2001-08-21 14:28 ` Remi VANICAT
2001-08-22  1:54 ` John Max Skaller [this message]
2001-08-23  8:26 ` Xavier Leroy

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=3B8310C8.4B09F8E1@maxtal.com.au \
    --to=skaller@maxtal.com.au \
    --cc=Francis.Dupont@enst-bretagne.fr \
    --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;
as well as URLs for NNTP newsgroup(s).