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

Safe HaskellSafe-Inferred
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) 
Show d => Show (Form d)