caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: David Teller <David.Teller@univ-orleans.fr>
To: Dawid Toton <dawid.toton@uj.edu.pl>
Cc: Caml List <caml-list@inria.fr>
Subject: Re: [Caml-list] Fine-grained types with more general library
Date: Sun, 10 Feb 2008 20:22:50 +0100	[thread overview]
Message-ID: <1202671370.6278.11.camel@Blefuscu> (raw)
In-Reply-To: <47AF4B6E.3070306@uj.edu.pl>

I'm not sure I understand the question. Still, if you haven't used
phantom types yet, it sounds like the right thing to do:
 type 'a path = string list
 type remote_t = Remote path
 type local_t  = Local path

Now, you can write things such as

val print_local : Local path  -> unit  (*only works on local paths*)
val print_remote: Remote path -> unit  (*only works on remote paths*)
val print_any   : 'a path     -> unit  (*works with either*)

Does this help you ?

Cheers,
 David

-- 
David Teller
 Security of Distributed Systems
  http://www.univ-orleans.fr/lifo/Members/David.Teller
 Angry researcher: French Universities need reforms, but the LRU act
brings liquidations. 


      parent reply	other threads:[~2008-02-10 19:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-10 19:07 Dawid Toton
2008-02-10 19:15 ` [Caml-list] " Edgar Friendly
2008-02-10 19:20   ` Bünzli Daniel
2008-02-10 19:56   ` Dawid Toton
2008-02-10 19:22 ` David Teller [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=1202671370.6278.11.camel@Blefuscu \
    --to=david.teller@univ-orleans.fr \
    --cc=caml-list@inria.fr \
    --cc=dawid.toton@uj.edu.pl \
    /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).