On Wed, 2005-08-17 at 14:19 +0200, Alain Frisch wrote: > Richard Jones wrote: > > On Tue, Aug 16, 2005 at 05:34:38PM +0100, Jon Harrop wrote: > > > >>Currently, you cannot match [|1; ...|] in OCaml. > > > > > > Yes! Or, "prefix" ^ str. > > This seems like a good place to insert a shameless plug. Thank you. In > OCamlDuce (the extension of OCaml with XML types and patterns), you can > indeed match on string prefixes: > > # type t = {{ "OCaml" | "OCamlDuce" | "Other" }};; Actually it is worth reading Alain's tree automata paper: the idea of regular sets of strings being types brings exception clarity to the presentation. -- John Skaller