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 DAA18985; Tue, 4 Mar 2003 03:04:12 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id DAA18665 for ; Tue, 4 Mar 2003 03:04:08 +0100 (MET) Received: from wetware.wetware.com (wetware.wetware.com [199.108.16.1]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id h24247T11930 for ; Tue, 4 Mar 2003 03:04:07 +0100 (MET) Received: from wetware.com(ra03.wetware.com[199.108.16.83]) (3701 bytes) by wetware.wetware.com via sendmail with P:esmtp/R:bind_hosts/T:inet_zone_bind_smtp (sender: ) id for ; Mon, 3 Mar 2003 18:04:06 -0800 (PST) (Smail-3.2.0.114 2001-Aug-6 #1 built 2002-Sep-2) Date: Mon, 3 Mar 2003 18:04:11 -0800 Subject: Re: [Caml-list] extensional polymorphism Content-Type: text/plain; charset=US-ASCII; format=flowed Mime-Version: 1.0 (Apple Message framework v551) Cc: The Trade To: brogoff@speakeasy.net From: james woodyatt In-Reply-To: Message-Id: <97A630BE-4DE5-11D7-A907-000393BA7EBA@wetware.com> Content-Transfer-Encoding: 7bit X-Mailer: Apple Mail (2.551) X-Spam: no; 0.00; woodyatt:01 jhw:01 wetware:01 caml-list:01 extensional:01 brogoff:01 agitate:01 notations:01 monad:01 monads:01 monadic:01 haskell:01 wadler's:01 referential:01 g'caml:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Monday, Mar 3, 2003, at 17:10 US/Pacific, brogoff@speakeasy.net wrote: > On Mon, 3 Mar 2003, james woodyatt wrote: >> On Monday, Mar 3, 2003, at 12:10 US/Pacific, brogoff@speakeasy.net >> wrote: >>> >>> That's why I said "Agitate for extensional polyorphism!". You really >>> want a way to overload similar notations. >> >> If "extensional polymorphism" is what I want in order to be able to >> define an operator ( >>= ) that performs the monad bind operation on >> arbitrary monads, then yeah-- I'm all for it. >> >> I recently discovered the power of monadic programming, but I am in >> no hurry to switch to Haskell in order to get a nice clean syntax for >> it. > > You can do a fair bit of monadic programming in OCaml now, using the > module > system. If you are interested, I'll show you, but you'll learn more by > just > translating Wadler's early papers into OCaml. If you want to do > complicated > monadics with several different monad types intertwined in the same > section of > code, that may be tricky. I want to do the tricky stuff. I've moved beyond the toys, and I'm beginning to discover all the interesting ways you can combine monads of different types. So far, I've been able to get away with limiting the scope of my monad types, but I'm wondering about what I can do when I don't have to worry about those limits. I tend to collect multiple monad types, each with a different number of type parameters to them. > Also, OCaml is an imperative language, so you have lots of monads > built in :-). Yeah, and I prefer them when I can use them. It's just that I've encountered a problem where I really want to avoid using the "built-in monad" types in fairly specific *parts* of my program. And I don't want to be constrained by the requirement of Haskell to maintain referential transparency *everywhere* in my program. > One of the problems I have with Haskell is that while there are a few > examples > where it just suits the problem so well that the solution is magically > concise and beautiful, I find that there are more places where the > emphasis on > purity transforms trivial programming problems into a PhD level > research > problems. > >> If "extensional polymorphism" will get me a cleaner syntax for monadic >> programming without forcing me to give up all the things that make >> Ocaml the best language in the universe for imperative programming, >> then sign me up right here right now. >> >> How would extensional polymorphism get me what I want? > > It may ameliorate the problem I cited above in which you're juggling > many monads > in the same section of code and you don't want to use (module) > qualified types > to distinguish your bindMs and returnMs or whatever you want to call > your > operations. I just read the G'CAML readme and the Jun Furuse thesis on its home page. It looks like it would basically work for what I want. Sign me up for wanting extensional polymorphism in the Ocaml core language. -- j h woodyatt ------------------- 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