Fwd: [Haskell-cafe] Proposal to solve Haskell's MPTC dilemma

Carlos Camarao carlos.camarao at gmail.com
Sat Jun 12 21:13:46 EDT 2010

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

---------- Forwarded message ----------
From: Carlos Camarao <carlos.camarao at 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 at ece.cmu.edu>

On Wed, Jun 9, 2010 at 1:51 AM, Brandon S. Allbery KF8NH <
allbery at 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 at kf8nh.com
> system administrator [openafs,heimdal,too many hats] allbery at 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 (

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


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20100612/dc9819ee/attachment.html

More information about the Haskell-Cafe mailing list