Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
Documentation
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)
Instances
retractFree :: Lattice a => Free a -> a Source #