[Haskell-cafe] chr/ord?

michael rice nowgate at yahoo.com
Tue Apr 28 23:58:26 EDT 2009


Yep, that fixed it..

Thanks, Brandon.

Michael

--- On Tue, 4/28/09, Brandon S. Allbery KF8NH <allbery at ece.cmu.edu> wrote:

From: Brandon S. Allbery KF8NH <allbery at ece.cmu.edu>
Subject: Re: [Haskell-cafe] chr/ord?
To: "michael rice" <nowgate at yahoo.com>
Cc: "Brandon S. Allbery KF8NH" <allbery at ece.cmu.edu>, "Tim Wawrzynczak" <inforichland at gmail.com>, "Lennart Augustsson" <lennart.augustsson at gmail.com>, "haskell-cafe at haskell.org" <haskell-cafe at haskell.org>
Date: Tuesday, April 28, 2009, 11:44 PM

On Apr 28, 2009, at 23:32 , michael rice wrote:Thank guys,

Now what am I misunderstanding in the code below?

lst = [('A',65),('B',66),('C',67),('D',68)]

You didn't give a type for lst, so it defaulted to [(Char,Integer)].  This is a manifestation of the Monomorphism Restriction, invoked because lst doesn't take any arguments:  it forces lst to have a definite type, so defaulting is used to fix the numeric part to Integer.
If you add a type specification for lst, things will work as you expect.
 -- brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allbery at kf8nh.comsystem administrator [openafs,heimdal,too many hats] allbery at ece.cmu.eduelectrical and computer engineering, carnegie mellon university    KF8NH
 



      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20090428/b5dbc724/attachment.htm


More information about the Haskell-Cafe mailing list