[Haskell-cafe] Re: Strings - why [Char] is not nice

ajb at spamcop.net ajb at spamcop.net
Wed Sep 29 00:48:31 EDT 2004

G'day all.

Quoting John Goerzen <jgoerzen at complete.org>:

>  * (++) is both a list and a string concatenation operator

This could easily be handle by a typeclass.

>  * Pattern matching works well with strings (that's my #1 gripe about
>    strings in OCaml)
>  * Thanks to the laziness of Haskell lists, things such as "lines" are
>    possible -- eliminating the hassle of loops/recursion to read file
>    data or the ugliness of reading an entire file at once.

These are good arguments for making Strings, however they're
implemented, _convertable_ to lazy lists.  Much like all of the
other containers which Haskell currently implements.

Andrew Bromage

More information about the Haskell-Cafe mailing list