while the following code:
postImportR = do
fi <- lookupFiles "file"
fc <- lift $ fileSource (fi !! 0) $$ consume
seems to work (at least can I "liftIO $ print fc), splitting it off to a function for iterating doesn't:
process :: [FileInfo] -> [String]
process [] = []
process (f:r) = do
fn <- fileName f
fc <- lift $ fileSource f $$ consume
([fn] : (process r))
postImportR = do
fi <- lookupFiles "file"
process fi
or even with a lambda function:
files <- L.map (\f -> (fileName f, lift $ fileSource f $$ consume)) fi
in the Handler it gives me a type error I don't understand.
Where's my fault -- liked to generate content for database import from the file's lines (and to learn some more Haskell, of course).