Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
Synopsis
- class Kleene k where
- class Kleene k => CharKleene c k | k -> c where
- oneof :: (CharKleene c k, Foldable f) => f c -> k
- class CharKleene c k => FiniteKleene c k | k -> c where
- class Derivate c k | k -> c where
- class Match c k | k -> c where
- class Match c k => Equivalent c k | k -> c where
- equivalent :: k -> k -> Bool
- class Derivate c k => TransitionMap c k | k -> c where
- transitionMap :: k -> Map k (SF c k)
- class Complement c k | k -> c where
- complement :: k -> k
- class ToLatin1 k where
Documentation
Kleene algebra.
If k
is Monoid
it's expected that
;
if appends
= mappend
k
is Lattice
it's expected that
.unions
= joins
Empty regex. Doesn't accept anything.
Empty string. Note: different than empty
.
Concatenation.
Union.
Kleene star.
class Kleene k => CharKleene c k | k -> c where Source #
Instances
(Ord c, Enum c, Bounded c) => CharKleene c (RE c) Source # | |
(Ord c, Enum c, Bounded c) => CharKleene c (ERE c) Source # | |
CharKleene c (M c) Source # | |
CharKleene c (r c) => CharKleene c (Equiv r c) Source # | |
oneof :: (CharKleene c k, Foldable f) => f c -> k Source #
One of the characters.
class CharKleene c k => FiniteKleene c k | k -> c where Source #
everything :: k Source #
Everything. \(\Sigma^\star\).
charRange :: c -> c -> k Source #
.charRange
a
z
= ^[a-z]$
fromRSet :: RSet c -> k Source #
Generalisation of charRange
.
.
Every character except new line \n
.
Any character. Note: different than dot
!
class Derivate c k | k -> c where Source #
nullable :: k -> Bool Source #
Does language contain an empty string?
derivate :: c -> k -> k Source #
Derivative of a language.
class Match c k | k -> c where Source #
An f
can be used to match on the input.
Instances
(Ord c, Enum c, Bounded c) => Match c (RE c) Source # | |
(Ord c, Enum c) => Match c (ERE c) Source # | |
Ord c => Match c (DFA c) Source # | Run Because we have analysed a language, in some cases we can determine a result
without traversing all of the input.
That's not the cases with
Holds:
all (match (fromRE r)) $ take 10 $ RE.generate (curry QC.choose) 42 (r :: RE.RE Char) |
(Eq c, Enum c, Bounded c) => Match c (M c) Source # | |
Match c (r c) => Match c (Equiv r c) Source # | |
class Match c k => Equivalent c k | k -> c where Source #
equivalent :: k -> k -> Bool Source #
Instances
(Ord c, Enum c, Bounded c) => Equivalent c (RE c) Source # | |
Defined in Kleene.Internal.RE | |
(Ord c, Enum c, Bounded c) => Equivalent c (ERE c) Source # | |
Defined in Kleene.ERE | |
Equivalent c (r c) => Equivalent c (Equiv r c) Source # | |
Defined in Kleene.Equiv |
class Derivate c k => TransitionMap c k | k -> c where Source #
Transition map.
transitionMap :: k -> Map k (SF c k) Source #
Instances
(Ord c, Enum c, Bounded c) => TransitionMap c (RE c) Source # | |
Defined in Kleene.Internal.RE | |
(Ord c, Enum c, Bounded c) => TransitionMap c (ERE c) Source # | |
Defined in Kleene.ERE |
class Complement c k | k -> c where Source #
complement :: k -> k Source #
Instances
Complement c (ERE c) Source # | |
Defined in Kleene.ERE complement :: ERE c -> ERE c Source # | |
(Ord c, Enum c, Bounded c) => Complement c (RE c) Source # | |
Defined in Kleene.DFA complement :: RE c -> RE c Source # | |
Complement c (DFA c) Source # | Complement DFA. Complement of
|
Defined in Kleene.DFA complement :: DFA c -> DFA c Source # | |
Complement c (r c) => Complement c (Equiv r c) Source # | |
Defined in Kleene.Equiv complement :: Equiv r c -> Equiv r c Source # |