CurryInfo: wl-pprint-3.0.0 / Text.Pretty.encloseSep

definition:
encloseSep :: Doc -> Doc -> Doc -> [Doc] -> Doc
encloseSep l r _ []     = l <> r
encloseSep l r s (d:ds) = align (enclose l r (cat (d : map (s <>) ds)))
demand:
argument 4
deterministic:
deterministic operation
documentation:
--- The document `(encloseSep l r s xs)` concatenates the documents `xs`
--- seperated by `s` and encloses the resulting document by `l` and `r`.
--- The documents are rendered horizontally if that fits the page. Otherwise
--- they are aligned vertically. All seperators are put in front of the
--- elements.
---
--- For example, the combinator `list` can be defined with `encloseSep`:
---
---     list xs  = encloseSep lbracket rbracket comma xs
---     test     = text "list" <+> (list (map int [10,200,3000]))
---
--- Which is layed out with a page width of 20 as:
---
---     list [10,200,3000]
---
--- But when the page width is 15, it is layed out as:
---
---     list [10
---          ,200
---          ,3000]
---
--- @param l  - left document
--- @param r  - right document
--- @param s  - a document as seperator
--- @param xs - a list of documents
--- @return concatenation of l, xs (with s in between) and r
failfree:
(_, _, _, _)
indeterministic:
referentially transparent operation
infix:
no fixity defined
iotype:
{(_,_,_,{[]}) |-> _ || (_,_,_,{:}) |-> {Doc}}
name:
encloseSep
precedence:
no precedence defined
result-values:
_
signature:
Text.PrettyImpl.Doc -> Text.PrettyImpl.Doc -> Text.PrettyImpl.Doc
-> [Text.PrettyImpl.Doc] -> Text.PrettyImpl.Doc
solution-complete:
operation might suspend on free variables
terminating:
yes
totally-defined:
possibly non-reducible on same data term