kleene-0: Kleene algebra

Safe HaskellSafe
LanguageHaskell2010

Kleene.Internal.Pretty

Synopsis

Documentation

class Pretty a where #

Pretty class.

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

Minimal complete definition

pretty | prettyS

Methods

pretty :: a -> String #

prettyS :: a -> ShowS #

Instances
Pretty Bool # 
Instance details

Defined in Kleene.Internal.Pretty

Methods

pretty :: Bool -> String #

prettyS :: Bool -> ShowS #

Pretty Char #

Escapes special regexp characters

Instance details

Defined in Kleene.Internal.Pretty

Methods

pretty :: Char -> String #

prettyS :: Char -> ShowS #

Pretty () # 
Instance details

Defined in Kleene.Internal.Pretty

Methods

pretty :: () -> String #

prettyS :: () -> ShowS #

c ~ Char => Pretty (RSet c) # 
Instance details

Defined in Kleene.Internal.Pretty

Methods

pretty :: RSet c -> String #

prettyS :: RSet c -> ShowS #

c ~ Char => Pretty (ERE c) # 
Instance details

Defined in Kleene.ERE

Methods

pretty :: ERE c -> String #

prettyS :: ERE c -> ShowS #

(Pretty c, Eq c) => Pretty (M c) # 
Instance details

Defined in Kleene.Monad

Methods

pretty :: M c -> String #

prettyS :: M c -> ShowS #

c ~ Char => Pretty (RE c) # 
Instance details

Defined in Kleene.RE

Methods

pretty :: RE c -> String #

prettyS :: RE c -> ShowS #

Show c => Pretty (DFA c) # 
Instance details

Defined in Kleene.DFA

Methods

pretty :: DFA c -> String #

prettyS :: DFA c -> ShowS #

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

Defined in Kleene.Equiv

Methods

pretty :: Equiv r c -> String #

prettyS :: Equiv r c -> ShowS #

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

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)*$
Instance details

Defined in Kleene.Functor

Methods

pretty :: K c a -> String #

prettyS :: K c a -> ShowS #

putPretty :: Pretty a => a -> IO () #