kleene-0.1: Kleene algebra

Safe HaskellTrustworthy
LanguageHaskell2010

Kleene.Equiv

Synopsis

Documentation

newtype Equiv r c Source #

Regular-expressions for which == is equivalent.

>>> let re1 = star "a" <> "a" :: RE Char
>>> let re2 = "a" <> star "a" :: RE Char
>>> re1 == re2
False
>>> Equiv re1 == Equiv re2
True

Equiv is also a PartialOrd (but not Ord!)

>>> Equiv "a" `leq` Equiv (star "a" :: RE Char)
True

Not all regular expessions are comparable:

>>> let reA = Equiv "a" :: Equiv RE Char
>>> let reB = Equiv "b" :: Equiv RE Char
>>> (leq reA reB, leq reB reA)
(False,False)

Constructors

Equiv (r c) 
Instances
Complement c (r c) => Complement c (Equiv r c) Source # 
Instance details

Defined in Kleene.Equiv

Methods

complement :: Equiv r c -> Equiv r c Source #

Equivalent c (r c) => Equivalent c (Equiv r c) Source # 
Instance details

Defined in Kleene.Equiv

Methods

equivalent :: Equiv r c -> Equiv r c -> Bool Source #

Match c (r c) => Match c (Equiv r c) Source # 
Instance details

Defined in Kleene.Equiv

Methods

match :: Equiv r c -> [c] -> Bool Source #

match8 :: Equiv r c -> ByteString -> Bool Source #

Derivate c (r c) => Derivate c (Equiv r c) Source # 
Instance details

Defined in Kleene.Equiv

Methods

nullable :: Equiv r c -> Bool Source #

derivate :: c -> Equiv r c -> Equiv r c Source #

CharKleene c (r c) => CharKleene c (Equiv r c) Source # 
Instance details

Defined in Kleene.Equiv

Methods

char :: c -> Equiv r c Source #

string :: [c] -> Equiv r c Source #

Equivalent c (r c) => Eq (Equiv r c) Source # 
Instance details

Defined in Kleene.Equiv

Methods

(==) :: Equiv r c -> Equiv r c -> Bool #

(/=) :: Equiv r c -> Equiv r c -> Bool #

Show (r c) => Show (Equiv r c) Source # 
Instance details

Defined in Kleene.Equiv

Methods

showsPrec :: Int -> Equiv r c -> ShowS #

show :: Equiv r c -> String #

showList :: [Equiv r c] -> ShowS #

Semigroup (r c) => Semigroup (Equiv r c) Source # 
Instance details

Defined in Kleene.Equiv

Methods

(<>) :: Equiv r c -> Equiv r c -> Equiv r c #

sconcat :: NonEmpty (Equiv r c) -> Equiv r c #

stimes :: Integral b => b -> Equiv r c -> Equiv r c #

Monoid (r c) => Monoid (Equiv r c) Source # 
Instance details

Defined in Kleene.Equiv

Methods

mempty :: Equiv r c #

mappend :: Equiv r c -> Equiv r c -> Equiv r c #

mconcat :: [Equiv r c] -> Equiv r c #

Lattice (r c) => Lattice (Equiv r c) Source # 
Instance details

Defined in Kleene.Equiv

Methods

(\/) :: Equiv r c -> Equiv r c -> Equiv r c #

(/\) :: Equiv r c -> Equiv r c -> Equiv r c #

BoundedJoinSemiLattice (r c) => BoundedJoinSemiLattice (Equiv r c) Source # 
Instance details

Defined in Kleene.Equiv

Methods

bottom :: Equiv r c #

BoundedMeetSemiLattice (r c) => BoundedMeetSemiLattice (Equiv r c) Source # 
Instance details

Defined in Kleene.Equiv

Methods

top :: Equiv r c #

(Lattice (r c), Equivalent c (r c)) => PartialOrd (Equiv r c) Source #

\(a \preceq b := a \lor b = b \)

Instance details

Defined in Kleene.Equiv

Methods

leq :: Equiv r c -> Equiv r c -> Bool #

comparable :: Equiv r c -> Equiv r c -> Bool #

Pretty (r c) => Pretty (Equiv r c) Source # 
Instance details

Defined in Kleene.Equiv

Methods

pretty :: Equiv r c -> String Source #

prettyS :: Equiv r c -> ShowS Source #

Kleene (r c) => Kleene (Equiv r c) Source # 
Instance details

Defined in Kleene.Equiv

Methods

empty :: Equiv r c Source #

eps :: Equiv r c Source #

appends :: [Equiv r c] -> Equiv r c Source #

unions :: [Equiv r c] -> Equiv r c Source #

star :: Equiv r c -> Equiv r c Source #

>>> import Kleene.RE (RE)