stateref: Abstraction for things that work like IORef.

[ data, public-domain ] [ Propose Tags ]

A collection of type-classes generalizing the read/write/modify operations for stateful variables provided by things like IORef, TVar, &c. Note that The interface has changed a bit from the 0.2.* version. "*Ref" functions are now called "*Reference" and new "*Ref" function exist with simpler signatures. The new Ref existential type provides a convenient monad-indexed reference type, and the HasRef class indicates monads for which there is a default reference type for every referent.


Automatic Flags

Include instances for STM types


Include instances for TMVar (TMVar is not available in hugs' STM implementation). I have been unable to make this flag's value depend on whether or not you're running hugs, so if you are, you'll just have to change it manually. It'd sure be nice if there were either an explicit backtrack command in cabal or if 'buildable:false' would trigger a backtrack. Or if I could say "default: not(impl(hugs))" for this flag. Note that this is irrelevant at the moment because I broke Hugs+STM support by adding MonadIO m => ... instances. If anyone really wants me to fix it, speak up - but those instances are pretty darn convenient.


Use -f <flag> to enable a flag, or -f -<flag> to disable that flag. More info


Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees


  • No Candidates
Versions [RSS], 0.3
Dependencies base (>=3 && <5), mtl, stm [details]
License LicenseRef-PublicDomain
Author James Cook <>
Maintainer James Cook <>
Category Data
Home page
Uploaded by JamesCook at 2009-11-19T17:27:06Z
Distributions Arch:0.3, Debian:0.3, LTSHaskell:0.3, NixOS:0.3, Stackage:0.3
Reverse Dependencies 6 direct, 65 indirect [details]
Downloads 9920 total (27 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs uploaded by user
Build status unknown [no reports yet]