>>> let doc = list (map pretty [1,20,300,4000])
>>> putDocW 80 doc [1, 20, 300, 4000]
>>> putDocW 10 doc [ 1 , 20 , 300 , 4000 ]
>>> 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.
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
div ! list "bar" $ "Hello."Result:
<div list="bar">Hello.</div>
>>> format (list stext) ["one", "two", "three"] "[one, two, three]"
>>> format (list shown) ["one", "two", "three"] "[\"one\", \"two\", \"three\"]"
>>> input (list natural) "[1, 2, 3]" [1,2,3]
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))