Created
May 5, 2012 02:14
-
-
Save b20n/2599108 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
processDevice :: FilePath -> IO Int | |
processDevice fp = do | |
contents <- readFile $ fp ++ "/size" | |
return $ read contents | |
main = do | |
files <- getDirectoryContents "/sys/block/sda" | |
print $ map processDevice files | |
-- blockdevice.hs:33:2: | |
-- No instance for (Show (IO Int)) | |
-- arising from a use of `print' at blockdevice.hs:33:2-6 | |
-- Possible fix: add an instance declaration for (Show (IO Int)) | |
-- In the first argument of `($)', namely `print' | |
-- In the expression: print $ map processDevice files | |
-- In the expression: | |
-- do { files <- getDirectoryContents "/sys/block/sda"; | |
-- print $ map processDevice files } | |
-- Failed, modules loaded: none. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment