automata-0.1.0.0: automata

Safe HaskellNone
LanguageHaskell2010

Automata.Nfsa.Builder

Synopsis

Documentation

data Builder t s a Source #

Instances
Monad (Builder t s) Source # 
Instance details

Defined in Automata.Nfsa.Builder

Methods

(>>=) :: Builder t s a -> (a -> Builder t s b) -> Builder t s b #

(>>) :: Builder t s a -> Builder t s b -> Builder t s b #

return :: a -> Builder t s a #

fail :: String -> Builder t s a #

Functor (Builder t s) Source # 
Instance details

Defined in Automata.Nfsa.Builder

Methods

fmap :: (a -> b) -> Builder t s a -> Builder t s b #

(<$) :: a -> Builder t s b -> Builder t s a #

Applicative (Builder t s) Source # 
Instance details

Defined in Automata.Nfsa.Builder

Methods

pure :: a -> Builder t s a #

(<*>) :: Builder t s (a -> b) -> Builder t s a -> Builder t s b #

liftA2 :: (a -> b -> c) -> Builder t s a -> Builder t s b -> Builder t s c #

(*>) :: Builder t s a -> Builder t s b -> Builder t s b #

(<*) :: Builder t s a -> Builder t s b -> Builder t s a #

run :: forall t a. (Bounded t, Ord t, Enum t) => (forall s. State s -> Builder t s a) -> Nfsa t Source #

The argument function takes a start state and builds an NFSA. This function will execute the builder.

state :: Builder t s (State s) Source #

Generate a new state in the NFA. On any input, the state transitions to zero states.

transition Source #

Arguments

:: t

inclusive lower bound

-> t

inclusive upper bound

-> State s

from state

-> State s

to state

-> Builder t s () 

Add a transition from one state to another when the input token is inside the inclusive range.

accept :: State s -> Builder t s () Source #

Mark a state as being an accepting state.

epsilon Source #

Arguments

:: State s

from state

-> State s

to state

-> Builder t s () 

Add a transition from one state to another that consumes no input.