Fold applies f recursively to all Docs in d.
(f func(a, b Doc) Doc, d ...Doc)
| 114 | |
| 115 | // Fold applies f recursively to all Docs in d. |
| 116 | func Fold(f func(a, b Doc) Doc, d ...Doc) Doc { |
| 117 | switch len(d) { |
| 118 | case 0: |
| 119 | return Nil |
| 120 | case 1: |
| 121 | return d[0] |
| 122 | default: |
| 123 | return f(d[0], Fold(f, d[1:]...)) |
| 124 | } |
| 125 | } |
| 126 | |
| 127 | // FoldMap applies f recursively to all Docs in d processed through g. |
| 128 | func FoldMap(f func(a, b Doc) Doc, g func(Doc) Doc, d ...Doc) Doc { |
no outgoing calls
no test coverage detected
searching dependent graphs…