“Side Effects” in Haskell
Suppose
tick :: String -> Integer
reads an integer n from a file with given name,
writes n+1 back to the file
returns n
Then tick == tick might be False!
Cannot replace equals by equals.
Not “purely functional”!
Föregående bild
Nästa bild
Tillbaka till första bilden
Visa grafisk version