kleene-0: Kleene algebra

Safe HaskellSafe
LanguageHaskell2010

Kleene.Internal.Pretty

Synopsis

Documentation

class Pretty a where Source #

Pretty class.

For pretty :: RE -> String gives a representation accepted by many regex engines.

Minimal complete definition

pretty | prettyS

Methods

pretty :: a -> String Source #

prettyS :: a -> ShowS Source #

Instances

Pretty Bool Source # 
Pretty Char Source #

Escapes special regexp characters

Pretty () Source # 

Methods

pretty :: () -> String Source #

prettyS :: () -> ShowS Source #

(~) * c Char => Pretty (RSet c) Source # 

Methods

pretty :: RSet c -> String Source #

prettyS :: RSet c -> ShowS Source #

(~) * c Char => Pretty (ERE c) Source # 

Methods

pretty :: ERE c -> String Source #

prettyS :: ERE c -> ShowS Source #

(Pretty c, Eq c) => Pretty (M c) Source # 

Methods

pretty :: M c -> String Source #

prettyS :: M c -> ShowS Source #

(~) * c Char => Pretty (RE c) Source # 

Methods

pretty :: RE c -> String Source #

prettyS :: RE c -> ShowS Source #

Show c => Pretty (DFA c) Source # 

Methods

pretty :: DFA c -> String Source #

prettyS :: DFA c -> ShowS Source #

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

Methods

pretty :: Equiv r c -> String Source #

prettyS :: Equiv r c -> ShowS Source #

(~) * c Char => Pretty (K c a) Source #

Convert to non-matching JavaScript string which can be used as an argument to new RegExp

>>> putPretty ("foobar" :: K Char String)
^foobar$
>>> putPretty $ many ("foobar" :: K Char String)
^(foobar)*$

Methods

pretty :: K c a -> String Source #

prettyS :: K c a -> ShowS Source #