digestive-functors-0.0.2.1: A general way to consume input using applicative functors

Text.Digestive.Result

Description

Module for the core result type, and related functions

Synopsis

Documentation

data Result e ok Source

Type for failing computations

Constructors

Error [(FormRange, e)] 
Ok ok 

Instances

Monad (Result e) 
Functor (Result e) 
Applicative (Result e) 
(Eq e, Eq ok) => Eq (Result e ok) 
(Show e, Show ok) => Show (Result e ok) 

data FormId Source

An ID used to identify forms

Constructors

FormId 

Instances

data FormRange Source

A range of ID's to specify a group of forms

Constructors

FormRange FormId FormId 

incrementFormId :: FormId -> FormIdSource

Increment a form ID

isInRangeSource

Arguments

:: FormId

Id to check for

-> FormRange

Range

-> Bool

If the range contains the id

Check if a FormId is contained in a FormRange

isSubRangeSource

Arguments

:: FormRange

Sub-range

-> FormRange

Larger range

-> Bool

If the sub-range is contained in the larger range

Check if a FormRange is contained in another FormRange

retainErrors :: FormRange -> [(FormRange, e)] -> [e]Source

Select the errors for a certain range

retainChildErrors :: FormRange -> [(FormRange, e)] -> [e]Source

Select the errors originating from this form or from any of the children of this form