[Haskell-beginners] pattern matching on strings ?

Konstantine Rybnikov k-bx at k-bx.com
Fri Feb 20 08:21:01 UTC 2015


Roelof,

If you are working with a String type, you should remember that its just a
list of chars:

type String = [Char]

So, you can take a look at different split functions at Data.List module.

If your strings are of type Text, look at Data.Text module for split
functions.

Cheers.
20 лют. 2015 08:32, користувач "Roelof Wobben" <r.wobben at home.nl> написав:

> Hello,
>
> Im try to the solve the exercise which does the following :
>
> "E 2 562 help he
>
> and convert it into
>
> (Error 2) 562 "help help
>
> First I thought to split the string on the " " but according to google
> Haskell do not have a split function.
>
> Can I use pattern matching on some way ?
>
> Roelof
>
> _______________________________________________
> Beginners mailing list
> Beginners at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/beginners/attachments/20150220/1545826f/attachment.html>


More information about the Beginners mailing list