expressions-0.5: Expressions and Formulae a la carte

Copyright (C) 2017-18 Jakub Daniel BSD-style (see the file LICENSE) Jakub Daniel experimental None Haskell2010

Data.Expression.Arithmetic

Description

Synopsis

# Documentation

data ArithmeticF a (s :: Sort) 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 # Instance detailsDefined in Data.Expression.Arithmetic Methodsieq1 :: IEq a => ArithmeticF a j -> ArithmeticF a j -> Bool Source # Source # Instance detailsDefined in Data.Expression.Arithmetic Methodsifold :: Monoid m => ArithmeticF (Const m) i' -> Const m i' Source # Source # Instance detailsDefined in Data.Expression.Arithmetic Methodsimap :: (forall (i' :: i). a i' -> b i') -> forall (i' :: i). ArithmeticF a i' -> ArithmeticF b i' Source #index :: ArithmeticF a i' -> Sing i' Source # Source # Instance detailsDefined in Data.Expression.Arithmetic Methodsitraverse :: Applicative f => (forall (i' :: i). a i' -> f (b i')) -> forall (i' :: i). ArithmeticF a i' -> f (ArithmeticF b i') Source # Source # Instance detailsDefined in Data.Expression.Arithmetic Methods Source # Instance detailsDefined in Data.Expression Methods Source # Instance detailsDefined in Data.Expression Methods Source # Instance detailsDefined in Data.Expression Methods Source # Instance detailsDefined in Data.Expression Methods Source # Instance detailsDefined in Data.Expression Methods Source # Instance detailsDefined in Data.Expression Methods Source # Instance detailsDefined in Data.Expression Methods Source # Instance detailsDefined in Data.Expression Methods Source # Instance detailsDefined in Data.Expression Methods Source # Instance detailsDefined in Data.Expression Methods Source # Instance detailsDefined in Data.Expression Methods Source # Instance detailsDefined in Data.Expression Methods Source # Instance detailsDefined in Data.Expression Methods Source # Instance detailsDefined in Data.Expression Methods Source # Instance detailsDefined in Data.Expression Methods Source # Instance detailsDefined in Data.Expression Methods Source # Instance detailsDefined in Data.Expression.Arithmetic Methods

A smart constructor for integer constants

cnsts :: forall f (s :: Sort). (ArithmeticF :<: f, IFoldable f, IFunctor f, IEq1 f) => IFix f s -> [IFix f IntegralSort] Source #

Collects a list of all constants occurring in an expression.

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

A smart constructor for a variadic addition

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 >=