monad-lgbt

Monad transformers for combining local and global state with backtracking/backjumping/continuations


Keywords
bsd2, control, library, Propose Tags , Control.Monad.Backtrack, Control.Monad.State.LGBT
License
BSD-3-Clause-Attribution
Install
cabal install monad-lgbt-0.0.1

Documentation

LGBT Monad transformers

This is library providing a nice typeclass interface for monads with two different states: local and global. Local state is backtraced whenever intervening monad transformer backtracks. Global state is preserved across all backtracing.

This has many use cases:

  1. Parser combinators may keep longest parse in the global state, and display it in case of error. Local state of parser combinator monad is of course the current state of the input.
  2. SAT engine would keep index of "hot" variables, and learned clauses, in global state, but watches in local state.

Intervening monad may allow many different actions:

  • ContT would allow arbitrary continuations.
  • LogicT monad for general logic programming.
  • One can also imagine backjumping monad that allows to backtrace multiple levels up.

INSTALL

Before running Cabal, you need to use hpack to generate .cabal file.

Build Status Hackage Hackage Dependencies

Details on official releases are on Hackage