digestive-functors-0.8.0.1: A practical formlet library

Safe HaskellSafe
LanguageHaskell98

Text.Digestive.Form.List

Description

Functionality related to index storage and the DefaultList type.

Synopsis

Documentation

indicesRef :: Text Source

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] -> Text Source

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 -> a Source

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