[Haskell-cafe] Re: instance Enum [Char] where ...

Brandon S. Allbery KF8NH allbery at ece.cmu.edu
Mon Dec 29 23:46:31 EST 2008

On 2008 Dec 29, at 23:27, Justin Goguen wrote:
> My purpose is to have operations such as ["aa".."bc"] be possible,  
> with its
> result being ["aa", "ab", "ac" ..<snip>.. "ba", "bb", "bc"]
> The example you provided for fromEnum seems to break down after a  
> string length
> of about 5 or so.

It will; toEnum and fromEnum are defined in terms of Int, not Integer,  
so they'll run into a maximum bounds issue.  (See section 6.3.4 of http://haskell.org/onlinereport/basic.html)

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

More information about the Haskell-Cafe mailing list