| Safe Haskell | Safe |
|---|---|
| Language | Haskell2010 |
Algebra.Lattice.Free
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 == rhsTrue
but when retracted, values are inequal
>>>retractFree lhs == retractFree rhsFalse
>>>(retractFree lhs, retractFree rhs)(M3a,M3i)
Instances
| Applicative Free Source # | |||||
| Functor Free Source # | |||||
| Monad Free Source # | |||||
| Foldable Free Source # | |||||
Defined in Algebra.Lattice.Free Methods fold :: Monoid m => Free m -> m foldMap :: Monoid m => (a -> m) -> Free a -> m foldMap' :: Monoid m => (a -> m) -> Free a -> m foldr :: (a -> b -> b) -> b -> Free a -> b foldr' :: (a -> b -> b) -> b -> Free a -> b foldl :: (b -> a -> b) -> b -> Free a -> b foldl' :: (b -> a -> b) -> b -> Free a -> b foldr1 :: (a -> a -> a) -> Free a -> a foldl1 :: (a -> a -> a) -> Free a -> a elem :: Eq a => a -> Free a -> Bool maximum :: Ord a => Free a -> a | |||||
| Traversable Free Source # | |||||
| Generic1 Free Source # | |||||
Defined in Algebra.Lattice.Free Associated Types
| |||||
| Arbitrary a => Arbitrary (Free a) Source # | |||||
| Data a => Data (Free a) Source # | |||||
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) gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Free a) dataTypeOf :: Free a -> DataType dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Free a)) dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Free a)) gmapT :: (forall b. Data b => b -> b) -> Free a -> Free a gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Free a -> r gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Free a -> r gmapQ :: (forall d. Data d => d -> u) -> Free a -> [u] gmapQi :: Int -> (forall d. Data d => d -> u) -> Free a -> u gmapM :: Monad m => (forall d. Data d => d -> m d) -> Free a -> m (Free a) gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Free a -> m (Free a) gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Free a -> m (Free a) | |||||
| Generic (Free a) Source # | |||||
Defined in Algebra.Lattice.Free Associated Types
| |||||
| Show a => Show (Free a) Source # | |||||
| Ord a => Eq (Free a) Source # | |||||
| Lattice (Free a) Source # | |||||
| Ord a => PartialOrd (Free a) Source # | |||||
| type Rep1 Free Source # | |||||
Defined in Algebra.Lattice.Free type Rep1 Free = D1 ('MetaData "Free" "Algebra.Lattice.Free" "lattices-2.2.1.1-DOiSBgvrTjdFgPaGHAnlJl" 'False) (C1 ('MetaCons "Var" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) Par1) :+: (C1 ('MetaCons ":/\\:" ('InfixI 'RightAssociative 6) 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec1 Free) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec1 Free)) :+: C1 ('MetaCons ":\\/:" ('InfixI 'RightAssociative 5) 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec1 Free) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec1 Free)))) | |||||
| type Rep (Free a) Source # | |||||
Defined in Algebra.Lattice.Free type Rep (Free a) = D1 ('MetaData "Free" "Algebra.Lattice.Free" "lattices-2.2.1.1-DOiSBgvrTjdFgPaGHAnlJl" 'False) (C1 ('MetaCons "Var" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a)) :+: (C1 ('MetaCons ":/\\:" ('InfixI 'RightAssociative 6) 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Free a)) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Free a))) :+: C1 ('MetaCons ":\\/:" ('InfixI 'RightAssociative 5) 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Free a)) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Free a))))) | |||||
retractFree :: Lattice a => Free a -> a Source #