module Control.Monad.Disj (
MonadDisj(..)
, contradictory
, contradictoryIf
, contradiction
, contradictionIf
, disjunctions
, disjunctionOfList
, DisjT(..)
, disjT
, runDisjT
, module Control.Monad
, module Control.Monad.Fix
, module Control.Monad.Trans
) where
import Control.Monad
import Control.Monad.Fix
import Control.Monad.Trans
import Control.Monad.Disj.Class
import Control.Monad.Trans.Disj
contradiction :: MonadDisj m => String -> m a
contradiction = contradictoryBecause . Just
contradictionIf :: MonadDisj m => Bool -> String -> m ()
contradictionIf b reason | b = contradiction reason
| otherwise = return ()
contradictory :: MonadDisj m => m a
contradictory = contradictoryBecause Nothing
contradictoryIf :: MonadDisj m => Bool -> m ()
contradictoryIf b | b = contradictory
| otherwise = return ()
disjunctions :: MonadDisj m => [m a] -> m a
disjunctions = foldr disjunction contradictory
disjunctionOfList :: MonadDisj m => [a] -> m a
disjunctionOfList = disjunctions . map return