tamarin-prover-utils-1.2.2: Utility library for the tamarin prover.

Copyright | (c) 2010 2011 Simon Meier
License | GPL v3 (see LICENSE)
Maintainer | Simon Meier <iridcode@gmail.com>
Portability | GHC only
Safe Haskell | None
Language | Haskell98

Control.Monad.Disj

Contents

- MonadDisj class
- The DisjT monad transformer
- Convencience exports

Description

Computations that need perform case distinctions.

Synopsis

- class Monad m => MonadDisj m where
- contradictory :: MonadDisj m => m a
- contradictoryIf :: MonadDisj m => Bool -> m ()
- contradiction :: MonadDisj m => String -> m a
- contradictionIf :: MonadDisj m => Bool -> String -> m ()
- disjunctions :: MonadDisj m => [m a] -> m a
- disjunctionOfList :: MonadDisj m => [a] -> m a
- newtype DisjT m a = DisjT {
  - unDisjT :: ListT m a
  }
- disjT :: m [a] -> DisjT m a
- runDisjT :: DisjT m a -> m [a]
- module Control.Monad
- module Control.Monad.Fix
- module Control.Monad.Trans

# MonadDisj class

class Monad m => MonadDisj m where #

Minimal complete definition

contradictoryBecause, disjunction

Methods

contradictoryBecause :: Maybe String -> m a #

Mark a contradiction.

disjunction :: m a -> m a -> m a #

Disjoin two computations.

Instances

MonadDisj Disj # |
Methods contradictoryBecause :: Maybe String -> Disj a # disjunction :: Disj a -> Disj a -> Disj a #
MonadDisj m => MonadDisj (FreshT m) # |
Methods contradictoryBecause :: Maybe String -> FreshT m a # disjunction :: FreshT m a -> FreshT m a -> FreshT m a #
Monad m => MonadDisj (DisjT m) # |
Methods contradictoryBecause :: Maybe String -> DisjT m a # disjunction :: DisjT m a -> DisjT m a -> DisjT m a #
MonadDisj m => MonadDisj (StateT s m) # |
Methods contradictoryBecause :: Maybe String -> StateT s m a # disjunction :: StateT s m a -> StateT s m a -> StateT s m a #
MonadDisj m => MonadDisj (StateT s m) # |
Methods contradictoryBecause :: Maybe String -> StateT s m a # disjunction :: StateT s m a -> StateT s m a -> StateT s m a #
MonadDisj m => MonadDisj (ReaderT * r m) # |
Methods contradictoryBecause :: Maybe String -> ReaderT * r m a # disjunction :: ReaderT * r m a -> ReaderT * r m a -> ReaderT * r m a #

contradictory :: MonadDisj m => m a #

`contradictory` denotes the logical false.

contradictoryIf :: MonadDisj m => Bool -> m () #

`contradictoryIf b` is logically equivalent to `not b`

contradiction :: MonadDisj m => String -> m a #

`contradiction reason` denotes the logical false, but also provides the `reason` as meta-information.

contradictionIf :: MonadDisj m => Bool -> String -> m () #

`contradictionIf b reason` is logically equivalent to `not b`, but also provides the `reason` as meta-information.

disjunctions :: MonadDisj m => [m a] -> m a #

`disjunctions ds` builds the disjunction of all the `ds` values.

disjunctionOfList :: MonadDisj m => [a] -> m a #

`disjunctionOfList xs` build the disjunction of the values in list `xs`.

# The DisjT monad transformer

newtype DisjT m a #

A disjunction of atoms of type a.

Constructors

DisjT |
Fields unDisjT :: ListT m a

Instances

MonadTrans DisjT # |
Methods lift :: Monad m => m a -> DisjT m a #
MonadReader r m => MonadReader r (DisjT m) # |
Methods ask :: DisjT m r # local :: (r -> r) -> DisjT m a -> DisjT m a # reader :: (r -> a) -> DisjT m a #
Monad m => Monad (DisjT m) # |
Methods (>>=) :: DisjT m a -> (a -> DisjT m b) -> DisjT m b # (>>) :: DisjT m a -> DisjT m b -> DisjT m b # return :: a -> DisjT m a # fail :: String -> DisjT m a #
Functor m => Functor (DisjT m) # |
Methods fmap :: (a -> b) -> DisjT m a -> DisjT m b # (<$) :: a -> DisjT m b -> DisjT m a #
Applicative m => Applicative (DisjT m) # |
Methods pure :: a -> DisjT m a # (<*>) :: DisjT m (a -> b) -> DisjT m a -> DisjT m b # (*>) :: DisjT m a -> DisjT m b -> DisjT m b # (<*) :: DisjT m a -> DisjT m b -> DisjT m a #
Monad m => MonadDisj (DisjT m) # |
Methods contradictoryBecause :: Maybe String -> DisjT m a # disjunction :: DisjT m a -> DisjT m a -> DisjT m a #

disjT :: m [a] -> DisjT m a #

Construct a `DisjT` action.

runDisjT :: DisjT m a -> m [a] #

Run a `DisjT` action.

# Convencience exports

module Control.Monad

module Control.Monad.Fix

module Control.Monad.Trans