descriptive-0.9.5: Self-describing consumers/parsers; forms, cmd-line args, JSON, etc.

Safe HaskellSafe
LanguageHaskell98

Descriptive.Form

Contents

Description

Validating form with named inputs.

Synopsis

Combinators

input :: Monad m => Text -> Consumer (Map Text Text) (Form d) m Text Source #

Consume any input value.

validate Source #

Arguments

:: Monad m 
=> d

Description of what it expects.

-> (a -> StateT s m (Maybe b))

Attempt to parse the value.

-> Consumer s (Form d) m a

Consumer to add validation to.

-> Consumer s (Form d) m b

A new validating consumer.

Validate a form input with a description of what's required.

Description

data Form d Source #

Form descriptor.

Constructors

Input !Text 
Constraint !d 
Instances
Eq d => Eq (Form d) Source # 
Instance details

Defined in Descriptive.Form

Methods

(==) :: Form d -> Form d -> Bool #

(/=) :: Form d -> Form d -> Bool #

Show d => Show (Form d) Source # 
Instance details

Defined in Descriptive.Form

Methods

showsPrec :: Int -> Form d -> ShowS #

show :: Form d -> String #

showList :: [Form d] -> ShowS #