import IO main = do x <- openFile "/tmp/foo.txt" ReadMode y <-hIsWritable x print y