packages feed

stateref-0.2.1.1: stateref.cabal

name:                   stateref
version:                0.2.1.1
stability:              provisional
license:                BSD3
license-file:           LICENSE

cabal-version:          >= 1.2
build-type:             Simple

author:                 James Cook <mokus@deepbondi.net>
maintainer:             James Cook <mokus@deepbondi.net>
homepage:               http://darcs.deepbondi.net/stateref

category:               Data
synopsis:               Abstraction for things that work like IORef.
description:            A collection of type-classes generalizing the
                        read\/write\/modify operations for stateful variables
                        provided by things like IORef, TVar, &c.

tested-with:            GHC

Flag useSTM
  Description:          Include instances for STM types
  Default:              True

Flag useTMVar
  Description:          Include instances for TMVar (TMVar 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.
                        
  Default:              True

Library
  hs-source-dirs:       src
  extensions:           CPP
  
  exposed-modules:      Data.Accessor
                        Data.StateRef
                        Data.StateRef.Classes
                        Data.StateRef.Instances
                        Data.MRef
                        Data.MRef.Classes
                        Data.MRef.Instances
  other-modules:        Data.StateRef.Instances.Undecidable
  
  if flag(useSTM)
    other-modules:      Data.StateRef.Instances.STM
                        Data.MRef.Instances.STM
    cpp-options:        -DuseSTM
    
    if flag(useTMVar)
      cpp-options:      -DuseTMVar
      
      if impl(hugs)
        buildable:      False
  
  build-depends:        base, mtl
  if flag(useSTM)
    build-depends:      stm