list

(list p) parses a list of things parsed by p, using the usual square-bracket syntax.
Haskell-inspired variant of encloseSep with braces and comma as separator.
>>> let doc = list (map pretty [1,20,300,4000])
>>> putDocW 80 doc
[1, 20, 300, 4000]
>>> putDocW 10 doc
[ 1
, 20
, 300
, 4000 ]
Call hc-pkg to get the source package Id of all the packages in the given package database. This is much less information than with dump, but also rather quicker. Note in particular that it does not include the UnitId, just the source PackageId which is not necessarily unique in any package db.
Generates a list using a Range to determine the length.
Shrink a list by edging towards the empty list.
>>> list [1,2,3]
[[],[2,3],[1,3],[1,2]]
>>> list "abcd"
["","cd","ab","bcd","acd","abd","abc"]
Note we always try the empty list first, as that is the optimal shrink.
Non-recursive transform over a list, like maybe.
list 1 (\v _ -> v - 2) [5,6,7] == 3
list 1 (\v _ -> v - 2) []      == 1
\nil cons xs -> maybe nil (uncurry cons) (uncons xs) == list nil cons xs
Combinator for the list attribute. Example:
div ! list "bar" $ "Hello."
Result:
<div list="bar">Hello.</div>
Fold all values into a list
Return the list of values generated by a Series. Useful for debugging Serial instances. Examples: The first two are equivalent. The second has a more explicit type binding.
Add square brackets around the Foldable (e.g. a list), and separate each formatted item with a comma and space.
>>> format (list stext) ["one", "two", "three"]
"[one, two, three]"
>>> format (list shown) ["one", "two", "three"]
"[\"one\", \"two\", \"three\"]"
Decode a list.
>>> input (list natural) "[1, 2, 3]"
[1,2,3]
The document (list xs) comma separates the documents xs and encloses them in square brackets. The documents are rendered horizontally if that fits the page. Otherwise they are aligned vertically. All comma separators are put in front of the elements.
Construct a list in terms of container t with element type e.
List-like destructor (like Data.Maybe.maybe)
The document (list xs) comma separates the documents xs and encloses them in square brackets. The documents are rendered horizontally if that fits the page. Otherwise they are aligned vertically. All comma separators are put in front of the elements.
Codec for list of values. Represented in TOML as array of tables. Example: Haskell [Int] can look like this in your TOML file:
foo =
[ {a = 1}
, {a = 2}
, {a = 3}
]
Decodes to an empty list [] when the key is not present.
list Type.listLines (take 30 (let fibs = 0 : 1 : zipWith (+) fibs (tail fibs) in fibs))
list Type.lines (take 30 (let fibs0 = 0 : fibs1; fibs1 = 1 : zipWith (+) fibs0 fibs1 in zip fibs0 fibs1))
Case analysis for lists