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
Fine-grained types with more general library
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2008-02-10 (19:22)
From: David Teller <David.Teller@u...>
Subject: Re: [Caml-list] Fine-grained types with more general library
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 ?


David Teller
 Security of Distributed Systems
 Angry researcher: French Universities need reforms, but the LRU act
brings liquidations.