Haskell searching through a large textfile efficiently
I think you've missed the forest for the trees. While the origin of your list might be IO, there's no need to carry values around inside the IO monad just because that's where you found them.

Write your functions as though the external world doesn't exist. E.g.—

-- Was `good`
pigExists :: String -&gt; Set String -&gt; Bool
pigExists word set = Set.member (toPigLatin word) set


Write your actions to set up the values you need to use your IO-ignorant functions. E.g.—

main :: IO ()
main = do
    allWords &lt;- words &lt;$&gt; readFile "wherever" -- equivalent to `allWords &lt;- wordList`
    let pigHits = map (\word -&gt; pigExists word (Set.fromList allWords)) allWords
    print $ length $ filter id pigHits -- Or some other IO action that does what you need


When in doubt, parameterize. You tripped yourself up by defining wordSet directly on wordList instead of just accepting any [String] value you're passed.