Your solution does not work because (||) works with Bool values, and Data.Char.isLetter and Data.Char.isSpace are of type Char -> Bool .
pl gives you:
$ pl "fx = ax || bx" f = liftM2 (||) ab
Explanation: liftM2 raises (||) into the monad (->) r , so the new type is (r -> Bool) -> (r -> Bool) -> (r -> Bool) .
So, in your case, we get:
import Control.Monad let normalise = filter (liftM2 (||) Data.Char.isLetter Data.Char.isSpace)
source share