
On 1/03/2015, at 11:17 pm, Roelof Wobben
Now I have to find out how I can test if the LogMessage has the text "this is not the right format" in it.
Well, the Haskell libraries include regular expression support. At an elementary level, you can always do is_prefix_of :: Eq x => [x] -> [x] -> Bool is_prefix_of (x:xs) (y:ys) = x == y && is_prefix_of xs ys is_prefix_of (x:xs) [] = False is_prefix_of [] _ = True is_infix_of :: Eq x => [x] -> [x] -> Bool is_infix_of xs ys = xs `is_prefix_of` ys || (not (null ys) && xs `is_infix_of` tail ys) "this is not the right format" `is_infix_of` aLogMessage But it would be better if your LogMessage were not a string but something structured where you did not have to go looking for that text because you KNEW where to look for it.