Browse thread
[Caml-list] dynamic runtime cast in Ocaml
[
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: | Alain Frisch <frisch@c...> |
| Subject: | Re: [Caml-list] dynamic runtime cast in Ocaml |
On Thu, 7 Nov 2002, Jacques Garrigue wrote: > By the way, for the expressivity addict (Curry-style), there is now a > branch in CVS with support for a specific form of dependent types. Nice ! Do you have specific cases of application in mind ? It's amazing to see how Caml succeed in escaping ML jail (rows, HO polymorphism, etc...). > I plan to provide it as a patch after the next release. Any long-term plan for inclusion in OCaml ? I guess that backtracking unification could benefit to OCaml in other places (e.g.:undoing the effect of typing an ill-typed expression in the toplevel). > and this without any overloading... Well, you could also say that this is a lightweight solution for overloading ... Let's play a little bit ... # fun x -> multimatch x with (a, `A x) -> (a,x) | (a, `B y) -> a + y;; This expression has type int but is here used with type int * 'a Mmm, need to rewrite it this way: # fun x -> match x with (a, z) -> multimatch z with `A -> (a,x) | `B y -> a + y;; - : (int * [< `A & 'b = int * 'a | `B of int & 'b = int] as 'a) -> 'b = <fun> Do you have any paper/doc describing multimatch typing ? -- Alain ------------------- 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