
13 Aug
2020
13 Aug
'20
7:19 a.m.
Hello Alexander Il 13 agosto 2020 alle 13:02 Alexander Chen ha scritto:
allwords :: IO Int allwords = do dict <- readFile "data/dict.txt" return $ length [x | x <- dict , not $ '-' `elem` x]
`elem` has type: λ> :t elem elem :: Eq a => a -> [a] -> Bool -- almost You are comparing '-' (a `Char`) with `x` (another `Char`), hence you only need `==`. Does this make sense? —F