[Haskell-beginners] pattern matching on strings ?
Chaddaï Fouché
chaddai.fouche at gmail.com
Fri Feb 20 12:40:57 UTC 2015
>
> On Fri, 20 Feb 2015 08:32:17 +0100, Roelof Wobben <r.wobben at home.nl>
> wrote:
>
> First I thought to split the string on the " " but according to google
>> Haskell do not have a split function.
>
>
As others have already said, Haskell does in fact have a "split on spaces"
function (words), and several others flavors of splitting that makes it
possible to dissect your list as you wish. If you still want a split
function ala Perl, there is a solid "split
<https://hackage.haskell.org/package/split>" package on hackage which
propose several standard function and a very configurable generic version
of the split concept for all lists. Also, Data.Text comes with several
splitting functions for use with the Text datatype.
--
Jedaï
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/beginners/attachments/20150220/e6f94f77/attachment.html>
More information about the Beginners
mailing list