The do notation
I/O actions may be combined in sequence.
tick :: String -> IO Integer
tick f =
do contents <- readFile f
let n = read contents
writeFile f (show (n+1))
return n
Local
declaration
Scope
Föregående bild
Nästa bild
Tillbaka till första bilden
Visa grafisk version