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

David Menendez dave at zednenem.com
Tue Dec 30 00:10:31 EST 2008

On Mon, Dec 29, 2008 at 11:27 PM, Justin Goguen
<adekoba at hamiltonshells.ca> wrote:
> My purpose is to have operations such as ["aa".."bc"] be possible, with its
> result being ["aa", "ab", "ac" ..<snip>.. "ba", "bb", "bc"]

Are you planning to have this restricted to lower-case letters?
According to Char, one might expect "az" to be followed by "a{" and so
on up to "a\1114111". The number of possible 2-character strings is
larger than the number of Ints.

I suggest defining a special-purpose version from enumFromTo for
strings and leaving Enum alone.

Dave Menendez <dave at zednenem.com>

More information about the Haskell-Cafe mailing list