The safe-globals package

[ Tags: bsd3, data, library ] [ Propose Tags ]

This library provides a way to declare IORefs, TVars, Chans, etc. at the top level of a module.

This library does not prevent the software design problems caused by global state. Rather, it provides some implementation safety for those circumstances where global state really is necessary.

Fundamentally this library just provides Template Haskell macros for the usual unsafePerformIO trick, so it is subject to the same caveats. In particular, linking a module and then loading the same module dynamically through the GHC API may produce two copies of the same top-level variable. See the documentation of unsafePerformIO for additional compiler-specific requirements.

This library may not work properly on GHC before 7.4, due to a GHC bug: http://hackage.haskell.org/trac/ghc/ticket/5558


[Skip to Readme]

Properties

Versions 0.1, 0.1.1
Dependencies base (>=3 && <5), stm (>=2.1), template-haskell (>=2.4) [details]
License BSD3
Author Keegan McAllister <mcallister.keegan@gmail.com>
Maintainer Keegan McAllister <mcallister.keegan@gmail.com>
Category Data
Source repository head: git clone git://github.com/kmcallister/safe-globals
Uploaded Wed Dec 21 16:50:23 UTC 2011 by KeeganMcAllister
Distributions NixOS:0.1.1
Downloads 1058 total (3 in the last 30 days)
Rating 0.0 (0 ratings) [clear rating]
  • λ
  • λ
  • λ
Status Docs uploaded by user
Build status unknown [no reports yet]
Hackage Matrix CI

Modules

[Index]

Downloads

Maintainer's Corner

For package maintainers and hackage trustees


Readme for safe-globals-0.1.1

[back to package description]
safe-globals provides safe top-level mutable variables for Haskell,
which scope like ordinary values.

Documentation is hosted at http://hackage.haskell.org/package/safe-globals

To build the documentation yourself, run

  $ cabal configure && cabal haddock --hyperlink-source

This will produce HTML documentation under dist/doc/html/safe-globals