digestive-functors-0.8.4.0: 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] 
Instances
Functor DefaultList Source # 
Instance details

Defined in Text.Digestive.Form.List

Methods

fmap :: (a -> b) -> DefaultList a -> DefaultList b #

(<$) :: a -> DefaultList b -> DefaultList a #

Foldable DefaultList Source # 
Instance details

Defined in Text.Digestive.Form.List

Methods

fold :: Monoid m => DefaultList m -> m #

foldMap :: Monoid m => (a -> m) -> DefaultList a -> m #

foldr :: (a -> b -> b) -> b -> DefaultList a -> b #

foldr' :: (a -> b -> b) -> b -> DefaultList a -> b #

foldl :: (b -> a -> b) -> b -> DefaultList a -> b #

foldl' :: (b -> a -> b) -> b -> DefaultList a -> b #

foldr1 :: (a -> a -> a) -> DefaultList a -> a #

foldl1 :: (a -> a -> a) -> DefaultList a -> a #

toList :: DefaultList a -> [a] #

null :: DefaultList a -> Bool #

length :: DefaultList a -> Int #

elem :: Eq a => a -> DefaultList a -> Bool #

maximum :: Ord a => DefaultList a -> a #

minimum :: Ord a => DefaultList a -> a #

sum :: Num a => DefaultList a -> a #

product :: Num a => DefaultList a -> a #

Traversable DefaultList Source # 
Instance details

Defined in Text.Digestive.Form.List

Methods

traverse :: Applicative f => (a -> f b) -> DefaultList a -> f (DefaultList b) #

sequenceA :: Applicative f => DefaultList (f a) -> f (DefaultList a) #

mapM :: Monad m => (a -> m b) -> DefaultList a -> m (DefaultList b) #

sequence :: Monad m => DefaultList (m a) -> m (DefaultList a) #

defaultListIndex :: DefaultList a -> Int -> a Source #

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