Chaddaï Fouché schreef op 20-2-2015 om 13:40:
On Fri, 20 Feb 2015 08:32:17 +0100, Roelof Wobben <r.wobben@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" 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ï



Thanks all,

Then I have to think about the cases.

There are two cases which can fail. One is that the input is not the format Char Int [Char]  and one is that the first Char is not a I, W or E.

Is it wise to make on case of it. in pseudo-code  

!Errcode.isChar and !Errnumber.isInt and !ErrorText.isChar and Errcode !="W" and Errcode !="I" and Errcode != "E"  ->  Unknown "This is not in the right format"
ErrorText = "I"  ->  "( Info + ) " + Errcode + " " " + ErrText + """

Roelof