This is what I do:
postSomethingR = do
((res, _), _) <- runFormPost form
case res of
FormSuccess (account, file) -> do
bytes <- runResourceT $ fileSource file $$ sinkLbs
-- Parse the ByteString in another thread
parseHandler <- handlerToIO
liftIO $ forkIO $ parseHandler $ do
case CSV.parseCSV csvSettings (decodeUtf8 . toStrict $ bytes) of
Left err -> ...
Right vector -> runDB $ do ...
Sorry, I'm posting this from a cellphone.