lattices-2.1: Fine-grained library for constructing and manipulating lattices
Safe Haskell Safe
Language Haskell2010

Algebra.Lattice.Free

Synopsis

Documentation

data Free a Source #

Free distributive lattice.

Eq and PartialOrd instances aren't structural.

>>> (Var 'x' /\ Var 'y') == (Var 'y' /\ Var 'x' /\ Var 'x')
True
>>> Var 'x' == Var 'y'
False

This is distributive lattice.

>>> import Algebra.Lattice.M3 -- non distributive lattice
>>> let x = M3a; y = M3b; z = M3c
>>> let lhs = Var x \/ (Var y /\ Var z)
>>> let rhs = (Var x \/ Var y) /\ (Var x \/ Var z)

Free is distributive so

>>> lhs == rhs
True

but when retracted, values are inequal

>>> retractFree lhs == retractFree rhs
False
>>> (retractFree lhs, retractFree rhs)
(M3a,M3i)

Constructors

Var a
( Free a) :/\: ( Free a) infixr 6
( Free a) :\/: ( Free a) infixr 5

Instances

Instances details
Monad Free Source #
Instance details

Defined in Algebra.Lattice.Free

Functor Free Source #
Instance details

Defined in Algebra.Lattice.Free

Applicative Free Source #
Instance details

Defined in Algebra.Lattice.Free

Foldable Free Source #
Instance details

Defined in Algebra.Lattice.Free

Traversable Free Source #
Instance details

Defined in Algebra.Lattice.Free

Ord a => Eq ( Free a) Source #
Instance details

Defined in Algebra.Lattice.Free

Data a => Data ( Free a) Source #
Instance details

Defined in Algebra.Lattice.Free

Methods

gfoldl :: ( forall d b. Data d => c (d -> b) -> d -> c b) -> ( forall g. g -> c g) -> Free a -> c ( Free a) Source #

gunfold :: ( forall b r. Data b => c (b -> r) -> c r) -> ( forall r. r -> c r) -> Constr -> c ( Free a) Source #

toConstr :: Free a -> Constr Source #

dataTypeOf :: Free a -> DataType Source #

dataCast1 :: Typeable t => ( forall d. Data d => c (t d)) -> Maybe (c ( Free a)) Source #

dataCast2 :: Typeable t => ( forall d e. ( Data d, Data e) => c (t d e)) -> Maybe (c ( Free a)) Source #

gmapT :: ( forall b. Data b => b -> b) -> Free a -> Free a Source #

gmapQl :: (r -> r' -> r) -> r -> ( forall d. Data d => d -> r') -> Free a -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> ( forall d. Data d => d -> r') -> Free a -> r Source #

gmapQ :: ( forall d. Data d => d -> u) -> Free a -> [u] Source #

gmapQi :: Int -> ( forall d. Data d => d -> u) -> Free a -> u Source #

gmapM :: Monad m => ( forall d. Data d => d -> m d) -> Free a -> m ( Free a) Source #

gmapMp :: MonadPlus m => ( forall d. Data d => d -> m d) -> Free a -> m ( Free a) Source #

gmapMo :: MonadPlus m => ( forall d. Data d => d -> m d) -> Free a -> m ( Free a) Source #

Show a => Show ( Free a) Source #
Instance details

Defined in Algebra.Lattice.Free

Generic ( Free a) Source #
Instance details

Defined in Algebra.Lattice.Free

Associated Types

type Rep ( Free a) :: Type -> Type Source #

Arbitrary a => Arbitrary ( Free a) Source #
Instance details

Defined in Algebra.Lattice.Free

Ord a => PartialOrd ( Free a) Source #
Instance details

Defined in Algebra.Lattice.Free

Lattice ( Free a) Source #
Instance details

Defined in Algebra.Lattice.Free

Generic1 Free Source #
Instance details

Defined in Algebra.Lattice.Free

Associated Types

type Rep1 Free :: k -> Type Source #

Methods

from1 :: forall (a :: k). Free a -> Rep1 Free a Source #

to1 :: forall (a :: k). Rep1 Free a -> Free a Source #

type Rep ( Free a) Source #
Instance details

Defined in Algebra.Lattice.Free

type Rep1 Free Source #
Instance details

Defined in Algebra.Lattice.Free