caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: james woodyatt <jhw@wetware.com>
To: brogoff@speakeasy.net
Cc: The Trade <caml-list@inria.fr>
Subject: Re: [Caml-list] extensional polymorphism
Date: Mon, 3 Mar 2003 18:04:11 -0800	[thread overview]
Message-ID: <97A630BE-4DE5-11D7-A907-000393BA7EBA@wetware.com> (raw)
In-Reply-To: <Pine.LNX.4.44.0303031649160.9492-100000@grace.speakeasy.net>

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 <jhw@wetware.com>

-------------------
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-03-04  2:04 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-03-03 18:28 [oliver: Re: [Caml-list] Strings as arrays or lists...] Oliver Bandel
2003-03-03 20:10 ` brogoff
2003-03-03 21:05   ` William Lovas
2003-03-03 21:32     ` Basile STARYNKEVITCH
2003-03-03 22:10     ` [Caml-list] [RANT] String representation (was: Strings as arrays or lists...) Nicolas George
2003-03-04 12:43       ` Diego Olivier Fernandez Pons
2003-03-04 16:14         ` William D. Neumann
2003-03-04 18:38           ` Xavier Leroy
2003-03-04 18:50             ` William D. Neumann
2003-03-04 19:01         ` Nicolas George
     [not found]       ` <Pine.A41.4.44.0303041312560.4431978-100000@ibm1.cicrp.juss ieu.fr>
2003-03-04 13:49         ` David Chase
2003-03-04  0:20     ` [oliver: Re: [Caml-list] Strings as arrays or lists...] Issac Trotts
2003-03-04  0:24       ` Alain.Frisch
2003-03-04  1:06         ` Issac Trotts
2003-03-04  0:39       ` Olivier Andrieu
2003-03-04  0:39     ` brogoff
2003-03-03 21:40   ` [Caml-list] extensional polymorphism james woodyatt
2003-03-04  1:10     ` brogoff
2003-03-04  2:04       ` james woodyatt [this message]

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=97A630BE-4DE5-11D7-A907-000393BA7EBA@wetware.com \
    --to=jhw@wetware.com \
    --cc=brogoff@speakeasy.net \
    --cc=caml-list@inria.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).