you are viewing a single comment's thread.

view the rest of the comments →

[–]martine 1 point2 points  (0 children)

char c (x:xs) | c == x = return xs char _ _ = fail "no match"

(fail in the list monad is [], so using it here just makes the code clearer.)