How do you save a file using conduit's library? I looked through conduit's tutorial but can't seem to find anything, here is my use case:
main :: IO ()
main = do
xxs <- lines <$> (readFile filePath)
sourceList xxs =$ pipe $$ saveFile
pipe :: Monad m => Conduit String m String
pipe = undefined
So there's two question here:
Does it make sense to use
lines
to convert a string into a list of strings and then feeding it tosourceList
?How should I implement the
saveFile
function so that when the stringsxxs
are fully processed, I can write it to disk?