I forgot to cc the message below to haskell-cafe...

---------- Forwarded message ----------
From: Carlos Camarao <carlos.camarao@gmail.com>
Date: Thu, Jun 10, 2010 at 4:40 PM
Subject: Re: [Haskell-cafe] Proposal to solve Haskell's MPTC dilemma
To: "Brandon S. Allbery KF8NH" <allbery@ece.cmu.edu>


On Wed, Jun 9, 2010 at 1:51 AM, Brandon S. Allbery KF8NH <allbery@ece.cmu.edu> wrote:
On Jun 8, 2010, at 15:32 , Job Vranish wrote:
It seems like this would make working with MPTCs much easier.
When programming, I generally want to only specify the minimum amount of information to make my code logically unambiguous.
If the code contains enough information to infer the proper instantiation without the use of an FD, then I shouldn't need to add a FD.
It seems like this would have much more of a "it just works" feel than the currently alternatives.

I can't help but think that the "it just works" mentality leads to duck typing.

-- 
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allbery@kf8nh.com
system administrator [openafs,heimdal,too many hats] allbery@ece.cmu.edu
electrical and computer engineering, carnegie mellon university    KF8NH

 
Perhaps I am missing something, but if we have, say,
 
  quack o::IO() (or in_the_forest o:: IO(),
                           or, say, f o:: Bool (en.wikipedia.org/wiki/Duck_typing))

then: "o" can be a duck, or a dragon, that quacks, but there is no
dynamic binding: o's type must be the only type with a function quack in this context
(it cannot be both duck and dragon in this context, one being chosen
dynamically according to the value of "o").

This avoids the problem of calling quack for an incorrect value
(there can be no dragons into a pond, trying to impersonate a duck).

Cheers,

Carlos