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] First order compile time functorial polymorphism in Ocaml
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Jacques Garrigue <garrigue@k...>
Subject: Re: [Caml-list] First order compile time functorial polymorphism in Ocaml
From: "Jacques Carette" <>

> > or perhaps
> > 	| #usual_case ->
> > instead of the last line if there happens to be
> > a type partition matching the requirements.
> I read about #types in the Ocaml manual.  Are you referring to using
> classes or the (documented obsolete) expansion of variant types ?

I know this is a bit confusing, but this is the pattern case expansion
of polymorphic variants (the above is a pattern-matching, not a type),
and this is not obsolete.
The notatation is obsolete in types, as [< usual_case] is more
symmetric with [> usual_case]. By the way,
  fun #usual_case as x -> x
has type
  [< usual_case] -> [> usual_case]

But honestly, if you have no particular need to cut your type in small
pieces (you need it for incremental extension for instance), you're
better off with sum types, and the safe approach I presented in my
previous mail.


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