I am trying to read and print the output from the "readProcess" command mapped onto a list of filenames:
files <- readProcess "ls" [] []
let mdList = map ( \file -> do
md <- readProcess "mdls" [file] []
return md ) $ splitOn "\n" files in
map (\md -> putStrLn md) mdList
putStrLn "Complete"
Each time I try to map putStrLn onto the mdList, I get this error:
Couldn't match type ‘IO String’ with ‘[Char]’
I have read many StackOverflow answers that seem to just use putStrLn on an IO String but I am unable to do so. Also, I am new to Haskell so any other tips are also appreciated.