From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id EAA05563; Wed, 25 Jun 2003 04:28:15 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id EAA06042 for ; Wed, 25 Jun 2003 04:28:12 +0200 (MET DST) Received: from mail3.tpgi.com.au (mail.tpgi.com.au [203.12.160.59]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id h5P2SAf23334 for ; Wed, 25 Jun 2003 04:28:11 +0200 (MET DST) Received: from ozemail.com.au (203-219-234-83-syd-ts25-2600.tpgi.com.au [203.219.234.83]) (authenticated (0 bits)) by mail3.tpgi.com.au (8.11.6/8.11.6) with ESMTP id h5P2Rpt19096; Wed, 25 Jun 2003 12:27:52 +1000 Message-ID: <3EF908A6.1040201@ozemail.com.au> Date: Wed, 25 Jun 2003 12:27:50 +1000 From: John Max Skaller User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.2.1) Gecko/20010901 X-Accept-Language: en-us MIME-Version: 1.0 To: Jacques Garrigue CC: carette@mcmaster.ca, caml-list@inria.fr Subject: Re: [Caml-list] First order compile time functorial polymorphism in Ocaml References: <3EF847E2.1010501@ozemail.com.au> <20030625084518L.garrigue@kurims.kyoto-u.ac.jp> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam: no; 0.00; ozemail:01 caml-list:01 functorial:01 jacques:01 covariance:01 recursion:01 outstanding:99 fixpoint:01 minimise:01 recursively:01 toxteth:01 glebe:01 2037,:01 9660:01 0850:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Jacques Garrigue wrote: > From: "Jacques Carette" > 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. That was very cute! I'm implementing it now. WITH polymorphic variants. WITH cutting up the types. Even supports covariance via parameterisation trick. Seems to work so far. I do use exact types though. I expect the open recursion technique will actually solve an outstanding problem. I have a two functions, fold and unfold which operate on type representations. Unfold is fine: its the identity unless the fixpoint binder is the top term. Fold doesn't work properly: it will undo a fold, but it doesn't do what I really need: to minimise the representation of a type be recursively folding every node. You just showed me how to fix that (in principle at least): its very cute to modify a function that works on the top level only, into one rebuilds the tree bottom up. -- John Max Skaller, mailto:skaller@ozemail.com.au snail:10/1 Toxteth Rd, Glebe, NSW 2037, Australia. voice:61-2-9660-0850 ------------------- 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