The acme-realworld package

[Tags: bsd3, library]

GHC represents an IO action internally as a function from one state of the world to the next:

State# RealWorld -> (# State# RealWorld, a #)

This module provides a very useful capability stemming directly from this representation: the ability to save the current state of the universe and restore it later. This provides a way to "undo" certain types of side effects in the IO monad:

import Acme.Missiles
import Acme.RealWorld

main :: IO ()
main = do
    -- Save the current state of the universe
    world_as_we_know_it <- getWorld

    -- Cause serious international side effects

    -- After realizing that was a terrible, terrible mistake, restore the
    -- pre-war state of the universe.
    putWorld world_as_we_know_it


Versions0.1, 0.1.1
Change logNone available
Dependenciesbase (==4.*) [details]
CopyrightCopyright (c) Joseph Adams 2011
AuthorJoey Adams
UploadedFri Dec 9 06:22:24 UTC 2011 by JoeyAdams
Downloads639 total (2 in last 30 days)
0 []
StatusDocs not available [build log]
All reported builds failed as of 2015-12-09 [all 6 reports]



Maintainers' corner

For package maintainers and hackage trustees