expressions-0.1.1: Expressions and Formulas a la carte

Data.Expression.Arithmetic

Description

Synopsis

# Documentation

data ArithmeticF a s where Source #

A functor representing linear integer arithmetic: constants (cnst), addition (add or .+.), multiplication (mul or .*.), divisibility predicate (.\.) and ordering (.<., .>., .<=., .>=.).

Constructors

 Const :: Int -> ArithmeticF a IntegralSort Add :: [a IntegralSort] -> ArithmeticF a IntegralSort Mul :: [a IntegralSort] -> ArithmeticF a IntegralSort Divides :: Int -> a IntegralSort -> ArithmeticF a BooleanSort LessThan :: a IntegralSort -> a IntegralSort -> ArithmeticF a BooleanSort

Instances

 Source # Methodsifold :: Monoid m => f (Const ArithmeticF m) i' -> Const ArithmeticF m i' Source # Source # Methodsieq1 :: IEq ArithmeticF a => f a j -> f a j -> Bool Source # Source # Methodsimap :: (forall i'. a i' -> b i') -> forall i'. f a i' -> f b i' Source #index :: f a i' -> Sing ArithmeticF i' Source # Source # Methodsitraverse :: Applicative f => (forall i'. a i' -> f (b i')) -> forall i'. t a i' -> f (t b i') Source # Source # Methodsishow :: f (Const k String) i -> Const ArithmeticF String i Source # # Methods # Methods # Methods # Methods # Methods # Methods # Methods # Methods # # # # # Methods # Methods # Methods # Methods # Methods # Methods # Methods # Methods # # # # Source # Methods Source # Methods Source # Methods Source # Methods (:<:) Sort ArithmeticF f => Parseable ((Sort -> *) -> Sort -> *) ArithmeticF f Source # Methods

A smart constructor for integer constants

add :: ArithmeticF :<: f => [IFix f IntegralSort] -> IFix f IntegralSort Source #

mul :: ArithmeticF :<: f => [IFix f IntegralSort] -> IFix f IntegralSort Source #

A smart constructor for a variadic multiplication

(.+.) :: forall f. ArithmeticF :<: f => IFix f IntegralSort -> IFix f IntegralSort -> IFix f IntegralSort infixl 8 Source #

A smart constructor for binary addition

(.*.) :: forall f. ArithmeticF :<: f => IFix f IntegralSort -> IFix f IntegralSort -> IFix f IntegralSort infixl 9 Source #

A smart constructor for a binary multiplication

(.\.) :: ArithmeticF :<: f => Int -> IFix f IntegralSort -> IFix f BooleanSort infix 7 Source #

A smart constructor for a divisibility predicate

(.<.) :: forall f. ArithmeticF :<: f => IFix f IntegralSort -> IFix f IntegralSort -> IFix f BooleanSort infix 7 Source #

A smart constructor for <

(.>.) :: forall f. ArithmeticF :<: f => IFix f IntegralSort -> IFix f IntegralSort -> IFix f BooleanSort infix 7 Source #

A smart constructor for >

(.<=.) :: forall f. ArithmeticF :<: f => IFix f IntegralSort -> IFix f IntegralSort -> IFix f BooleanSort infix 7 Source #

A smart constructor for <=

(.>=.) :: forall f. ArithmeticF :<: f => IFix f IntegralSort -> IFix f IntegralSort -> IFix f BooleanSort infix 7 Source #

A smart constructor for >=