Copyright(c) Stéphane Vialette, 2015
LicenseMIT
Maintainervialette@gmail.com
Stabilityexperimental
Safe HaskellSafe-Inferred

Literal

Description

 

Synopsis

Documentation

data Literal a

Literal type

Constructors

Negative (Variable a) 
Positive (Variable a) 

Instances

Eq a => Eq (Literal a) 
Ord a => Ord (Literal a) 
Show a => Show (Literal a) 

variable :: Literal t -> Variable t

The variable function returns the variable associated to a literal.

oppositeLiteral :: Literal a -> Literal a

The oppositeLiteral function returns the opposite literal of a literal.

>>> oppositeLiteral $ Positive 1
NegativeLiteral 1
>>> oppositeLiteral $ NegativeLiteral 1
Positive 1

isPositive :: Literal a -> Bool

The isPositive function returns True if a literal is a positive literal.

isNegative :: Literal a -> Bool

The isNegativeLiteral function return True if a literal is a negative literal.