Newsgroups: fa.caml
From: Serge Aleynikov <se...@hq.idt.net>
Date: Tue, 07 Nov 2006 00:17:24 UTC
Local: Mon, Nov 6 2006 7:17 pm
Subject: Re: [Caml-list] parameterized pattern
Jon Harrop wrote: I had a similar reaction when I saw that construct in the formal > On Monday 06 November 2006 21:15, Serge Aleynikov wrote: >> Could anyone point at a suitable resource? > I wasn't even aware that you could add type annotations inside a pattern. language spec. > Your Thanks. Several people also replied clarifying that the type > example will not work simply because OCaml's type system will not allow float > to unify with string. You need some context where type inference will allow > different possibilities, like a tuple containing both a float and a string: > # let f = function > or a polymorphic variant containing either a float or a string: > # let f = function annotations were merely used for aiding the type inferencer. Serge -- _______________________________________________ You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||