Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] Yelling
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2003-04-23 (15:56)
From: Eray Ozkural <exa@k...>
Subject: Re: [Caml-list] Yelling

Just what I was looking for (^_^)

I didn't know of this syntax. I used functors here and there but I'm not too 
experienced in using signatures yet. I'm relatively new to ocaml and 
therefore constantly seeing things that surprise me!


On Wednesday 23 April 2003 17:56, Neel Krishnaswami wrote:
>   module Foo : FOO =
>     struct
>       type t = Foo of unit
>       let v = Foo()
>     end
>   module Bar : BAR with type t = Foo.t =
>     struct
>       include Foo (* Add the type t and value v to the Foo module *)
>       let v' = v
>     end
> The "with type t = Foo.t" thing at the top of Bar is a sharing
> declaration. It informs the compiler that the type Bar.t is the same
> as the type Foo.t, so you can freely intermix Foo.t and Bar.t values.
> (Otherwise the compiler would forbid it, on the grounds that these are
> two different abstract types.)
> I hope this helps!

Eray Ozkural (exa) <>
Comp. Sci. Dept., Bilkent University, Ankara  KDE Project:
www:  Malfunction:
GPG public key fingerprint: 360C 852F 88B0 A745 F31B  EA0F 7C07 AE16 874D 539C

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: