caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Eray Ozkural <exa@kablonet.com.tr>
To: Neel Krishnaswami <neelk@alum.mit.edu>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] Yelling
Date: Wed, 23 Apr 2003 18:56:00 +0300	[thread overview]
Message-ID: <200304231856.00290.exa@kablonet.com.tr> (raw)
In-Reply-To: <16038.43443.192953.705022@h00045a4799d6.ne.client2.attbi.com>


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!

Thanks!

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) <erayo@cs.bilkent.edu.tr>
Comp. Sci. Dept., Bilkent University, Ankara  KDE Project: http://www.kde.org
www: http://www.cs.bilkent.edu.tr/~erayo  Malfunction: http://mp3.com/ariza
GPG public key fingerprint: 360C 852F 88B0 A745 F31B  EA0F 7C07 AE16 874D 539C

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


      parent reply	other threads:[~2003-04-23 15:56 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-04-23 14:16 Eray Ozkural
2003-04-23 14:56 ` Neel Krishnaswami
     [not found]   ` <3EA6AB00.7020305@post.tepkom.ru>
2003-04-23 15:31     ` Neel Krishnaswami
2003-04-23 15:50       ` Eray Ozkural
2003-04-24  7:58       ` Hendrik Tews
2003-04-23 15:33   ` Andreas Rossberg
2003-04-23 15:56   ` Eray Ozkural [this message]

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=200304231856.00290.exa@kablonet.com.tr \
    --to=exa@kablonet.com.tr \
    --cc=caml-list@inria.fr \
    --cc=erayo@cs.bilkent.edu.tr \
    --cc=neelk@alum.mit.edu \
    /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).