A Confession
This program doesn’t work!
tick :: String -> IO Integer
tick f =
do contents <- readFile f
let n = read contents
n `seq` writeFile f (show (n+1))
return n
`seq` evaluates
its first argument,
then returns its
second.
Föregående bild
Nästa bild
Tillbaka till första bilden
Visa grafisk version