digestive-functors-0.7.1.1: A practical formlet library

Safe HaskellNone

Text.Digestive.Form.List

Description

Functionality related to index storage and the DefaultList type.

Synopsis

Documentation

indicesRef :: TextSource

Key used to store list indices

parseIndices :: Text -> [Int]Source

Parse a string of comma-delimited integers to a list. Unparseable substrings are left out of the result.

unparseIndices :: [Int] -> TextSource

Serialize a list of integers as a comma-delimited Text

data DefaultList a Source

A list which, when indexed on non-existant positions, returns a default value.

Constructors

DefaultList a [a] 

defaultListIndex :: DefaultList a -> Int -> aSource

Safe indexing of a DefaultList - returns the default value if the given index is out of bounds.