Right now I'm working on a program that removes everything but "a" in a text element just as a practice problem, here's my code.
{-# LANGUAGE OverloadedStrings #-}
import qualified Data.Char as C
import qualified Data.Text as T
removeNonAs :: T.Text -> T.Text
removeNonAs txt = T.filter ("a") txt
My problem is with the placeholder "a" in T.Filter. Every time I try to run the program it gives an error message saying (class) isn't Char -> Bool. I used to use elem` "a" which worked fine but then I added OverloadedStrings Which made it not work and give an "ambiguous type variable" error message. I am very confused with what made elem` "a" stop working, what the whole Char -> Bool thing is about, and what to do. If you could help me thanks.