Browse thread
RE: [Caml-list] recursive modules redux, & interface files
- Dave Berry
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| From: | Dave Berry <Dave@k...> |
| Subject: | RE: [Caml-list] recursive modules redux, & interface files |
I'd say that the module Ten would have to include a declaration of the
sub-module PLAYER.
To be honest, I don't know whether there are counter-examples to the
suggestion. It may be unsound or impractical. I was just following a
single line of thought; I'm sure the idea would require lots more work
before it could be adopted, or it might not work at all.
-----Original Message-----
From: Tom Hirschowitz [mailto:Tom.Hirschowitz@inria.fr]
Sent: Friday, March 23, 2001 7:55
To: Dave Berry; caml-list@inria.fr
Subject: Re: [Caml-list] recursive modules redux, & interface files
Just curious, but how would you treat this?
module type TEN =
sig
module PLAYER : sig type t = Andre | Pete | Ivan | Cedric val name :
t -> string end
exception Not_Ex_No1 of PLAYER.t
type u = PLAYER.t -> PLAYER.t
end
module Ten =
struct
includesig TEN
...
end
Reject?
Friendly,
Tom
Dave Berry a écrit :
>
> To be more general, perhaps specifications could be interleaved with
> declarations in modules. In addition to including entire structures,
> this would let you specify the type of a function separately from it's
> implementation:
>
> val map: ('a -> 'b) -> 'a list -> 'b list
> let rec map f l =
> match ...
>
> This is one aspect I like about Haskell's syntax. I find it clearer
> than the current:
>
> let rec map (f: 'a -> 'b) (l: 'a list) =
> match ...
>
>
> type coleur = Rouge | Vert | Bleu
> (both type and implementation exported)
>
> type animal
> type animal = Chien | Chat | Oiseau
> (only the type is visible outside the module)
>
> I've no idea how easy or hard it would be to incorporate this into
> either the semantics or the implementation of the language. But from
a
> pragmatic point of view, it seems a relatively clean change.
>
> Dave.
>
> -----Original Message-----
> From: Hendrik Tews [mailto:tews@tcs.inf.tu-dresden.de]
> Sent: Thursday, March 22, 2001 12:03
> To: caml-list@inria.fr
> Subject: Re: [Caml-list] recursive modules redux, & interface files
>
> What about changing
> include, such that including a signature into a structure
> includes all types and all exceptions?
>
> -------------------
> To unsubscribe, mail caml-list-request@inria.fr. Archives:
http://caml.inria.fr
-------------------
To unsubscribe, mail caml-list-request@inria.fr. Archives: http://caml.inria.fr