Encapsulated Side Effects
IORefs can only be updated at the top level.
Can we use references internally to define a pure function?
Example
removeDuplicates :: Hashable a => [a] -> [a]
Use a hash table
internally to make
comparison fast.
No IO type:
no externally
visible side-effects!
Array operations
resemble reference ones.
Föregående bild
Nästa bild
Tillbaka till första bilden
Visa grafisk version