caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: skaller <skaller@ozemail.com.au>
To: Remi Vanicat <vanicat@labri.u-bordeaux.fr>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] tpyping question
Date: 12 Aug 2003 14:25:28 +1000	[thread overview]
Message-ID: <1060662327.19617.5.camel@localhost.localdomain> (raw)
In-Reply-To: <8765l4m30u.dlv@wanadoo.fr>

On Tue, 2003-08-12 at 05:02, Remi Vanicat wrote:
> skaller <skaller@ozemail.com.au> writes:
> 
> > In reality there are 20 tags, not just the 2 shown.
> > So I'd have to write:
> >
> > match x with
> > | .....
> > | `A _ as y 
> > | `B _ as y -> let (i,j) = match y with `A v->v | `B u -> (u,0) in ...
> > | ......
> 
> If `A (x,y) and `B x have a link (as it seem in your
> example) I would have define the type 
> 
> type aorB = [`A of int * int | `B of int]

I'd consider that if the relationship were strong
enough to abstract into a named type, meaning,
it applies to more than one or two switchings (match).

Unfortunately, the nature of compilers seem to be that
in each function the groupings are different. The reason for
this is probably that if they were not, then you'd not *just*
make a type unifying the two tags .. you'd just use a single
tag :-)



-------------------
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


  reply	other threads:[~2003-08-12  4:25 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-08-11  1:13 skaller
2003-08-11  2:46 ` Jacques Garrigue
2003-08-11  4:30   ` skaller
2003-08-12  3:24   ` Jacques Garrigue
2003-08-11  2:51 ` Oleg Trott
2003-08-11  4:39   ` skaller
2003-08-11  5:18     ` Karl Zilles
2003-08-11 18:13       ` Karl Zilles
2003-08-11 18:16       ` skaller
2003-08-11 19:02         ` Remi Vanicat
2003-08-12  4:25           ` skaller [this message]
2003-08-11 19:02         ` Tiphaine Turpin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1060662327.19617.5.camel@localhost.localdomain \
    --to=skaller@ozemail.com.au \
    --cc=caml-list@inria.fr \
    --cc=vanicat@labri.u-bordeaux.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).