Safe Haskell | Safe |
---|---|

Language | Haskell2010 |

# Documentation

Free distributive lattice.

`Eq`

and `PartialOrd`

instances aren't structural.

`>>>`

True`(Var 'x' /\ Var 'y') == (Var 'y' /\ Var 'x' /\ Var 'x')`

`>>>`

False`Var 'x' == Var 'y'`

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

`>>>`

True`lhs == rhs`

but when retracted, values are inequal

`>>>`

False`retractFree lhs == retractFree rhs`

`>>>`

(M3a,M3i)`(retractFree lhs, retractFree rhs)`

## Instances

retractFree :: Lattice a => Free a -> a Source #