unification-fd-0.11.0: Simple generic unification algorithms.
CopyrightCopyright (c) 2007--2015 wren gayle romano
LicenseBSD
Maintainerwren@community.haskell.org
Stabilityhighly experimental
Portabilitysemi-portable (MPTCs,...)
Safe HaskellNone
LanguageHaskell98

Control.Unification.Ranked.IntVar

Description

A ranked variant of Control.Unification.IntVar.

Synopsis

Documentation

newtype IntVar Source #

A "mutable" unification variable implemented by an integer. This provides an entirely pure alternative to truly mutable alternatives (like STVar), which can make backtracking easier.

N.B., because this implementation is pure, we can use it for both ranked and unranked monads.

Constructors

IntVar Int 

Instances

Instances details
Eq IntVar Source # 
Instance details

Defined in Control.Unification.IntVar

Methods

(==) :: IntVar -> IntVar -> Bool #

(/=) :: IntVar -> IntVar -> Bool #

Show IntVar Source # 
Instance details

Defined in Control.Unification.IntVar

Variable IntVar Source # 
Instance details

Defined in Control.Unification.IntVar

Methods

getVarID :: IntVar -> Int Source #

(Unifiable t, Applicative m, Monad m) => RankedBindingMonad t IntVar (IntRBindingT t m) Source # 
Instance details

Defined in Control.Unification.Ranked.IntVar

(Unifiable t, Applicative m, Monad m) => BindingMonad t IntVar (IntBindingT t m) Source # 
Instance details

Defined in Control.Unification.IntVar

(Unifiable t, Applicative m, Monad m) => BindingMonad t IntVar (IntRBindingT t m) Source # 
Instance details

Defined in Control.Unification.Ranked.IntVar

data IntRBindingState t Source #

Ranked binding state for IntVar.

Instances

Instances details
Show (t (UTerm t IntVar)) => Show (IntRBindingState t) Source # 
Instance details

Defined in Control.Unification.Ranked.IntVar

Monad m => MonadState (IntRBindingState t) (IntRBindingT t m) Source # 
Instance details

Defined in Control.Unification.Ranked.IntVar

data IntRBindingT t m a Source #

A monad for storing IntVar bindings, implemented as a StateT. For a plain state monad, set m = Identity; for a backtracking state monad, set m = Logic.

Instances

Instances details
(Unifiable t, Applicative m, Monad m) => RankedBindingMonad t IntVar (IntRBindingT t m) Source # 
Instance details

Defined in Control.Unification.Ranked.IntVar

(Unifiable t, Applicative m, Monad m) => BindingMonad t IntVar (IntRBindingT t m) Source # 
Instance details

Defined in Control.Unification.Ranked.IntVar

MonadTrans (IntRBindingT t) Source # 
Instance details

Defined in Control.Unification.Ranked.IntVar

Methods

lift :: Monad m => m a -> IntRBindingT t m a #

Monad m => MonadState (IntRBindingState t) (IntRBindingT t m) Source # 
Instance details

Defined in Control.Unification.Ranked.IntVar

Monad m => Monad (IntRBindingT t m) Source # 
Instance details

Defined in Control.Unification.Ranked.IntVar

Methods

(>>=) :: IntRBindingT t m a -> (a -> IntRBindingT t m b) -> IntRBindingT t m b #

(>>) :: IntRBindingT t m a -> IntRBindingT t m b -> IntRBindingT t m b #

return :: a -> IntRBindingT t m a #

Functor m => Functor (IntRBindingT t m) Source # 
Instance details

Defined in Control.Unification.Ranked.IntVar

Methods

fmap :: (a -> b) -> IntRBindingT t m a -> IntRBindingT t m b #

(<$) :: a -> IntRBindingT t m b -> IntRBindingT t m a #

(Functor m, Monad m) => Applicative (IntRBindingT t m) Source # 
Instance details

Defined in Control.Unification.Ranked.IntVar

Methods

pure :: a -> IntRBindingT t m a #

(<*>) :: IntRBindingT t m (a -> b) -> IntRBindingT t m a -> IntRBindingT t m b #

liftA2 :: (a -> b -> c) -> IntRBindingT t m a -> IntRBindingT t m b -> IntRBindingT t m c #

(*>) :: IntRBindingT t m a -> IntRBindingT t m b -> IntRBindingT t m b #

(<*) :: IntRBindingT t m a -> IntRBindingT t m b -> IntRBindingT t m a #

(Functor m, MonadPlus m) => Alternative (IntRBindingT t m) Source # 
Instance details

Defined in Control.Unification.Ranked.IntVar

Methods

empty :: IntRBindingT t m a #

(<|>) :: IntRBindingT t m a -> IntRBindingT t m a -> IntRBindingT t m a #

some :: IntRBindingT t m a -> IntRBindingT t m [a] #

many :: IntRBindingT t m a -> IntRBindingT t m [a] #

MonadPlus m => MonadPlus (IntRBindingT t m) Source # 
Instance details

Defined in Control.Unification.Ranked.IntVar

Methods

mzero :: IntRBindingT t m a #

mplus :: IntRBindingT t m a -> IntRBindingT t m a -> IntRBindingT t m a #

MonadLogic m => MonadLogic (IntRBindingT t m) Source # 
Instance details

Defined in Control.Unification.Ranked.IntVar

Methods

msplit :: IntRBindingT t m a -> IntRBindingT t m (Maybe (a, IntRBindingT t m a)) #

interleave :: IntRBindingT t m a -> IntRBindingT t m a -> IntRBindingT t m a #

(>>-) :: IntRBindingT t m a -> (a -> IntRBindingT t m b) -> IntRBindingT t m b #

ifte :: IntRBindingT t m a -> (a -> IntRBindingT t m b) -> IntRBindingT t m b -> IntRBindingT t m b #

once :: IntRBindingT t m a -> IntRBindingT t m a #

lnot :: IntRBindingT t m a -> IntRBindingT t m () #

evalIntRBindingT :: Monad m => IntRBindingT t m a -> m a Source #

N.B., you should explicitly apply bindings before calling this function, or else the bindings will be lost