I used no libraries and wrote all the math myself, because when I went to investigate libraries none of them seemed to explain what they do in language someone who didn't already know would understand. When I went in stackexchange and other community spaces I got similar results.
https://web.archive.org/web/20171020034308/https://crsr.net/...
import qualified Data.Text as T
import qualified Data.Text.IO as T
...
-- maybe you're reading things into a Set or something named acc
go acc = do
eof <- isEOF
if eof then pure acc
else do
line <- T.getLine
T.putStrLn ("LINE IS "<>line)
go (insert line acc)
There's hGetLine, hPutStrLn and hIsEOF for file handles, use withFile https://hackage.haskell.org/package/base-4.19.1.0/docs/Syste... which will close the handle when you exit the block. There are many more ways of doing this stuff of course, but the above will work fine for most stuff without any special libraries.In general, use Data.Text for anything that you don't consider binary data (human-readable text as well as code, config files and such). Use Data.ByteString if you're thinking of it as pure encoded bytes.
Could you post some examples of interactions you had on stackexchange? I'm interesting in improving the onboarding experience for new users, and knowing what do avoid will be helpful.