Content deleted Content added
m Task 18 (cosmetic): eval 9 templates: del empty params (1×); |
m Task 18 (cosmetic): eval 9 templates: hyphenate params (8×); |
||
Line 324:
|''<code>Iterable</code>''<code>.reduceRight''(func'')</code>
|
|Other collections also support <code>fold</code><ref>{{cite web |title=fold - Kotlin Programming Language |url=https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/fold.html |website=Kotlin |publisher=Jetbrains |
|- valign="top"
| [[LFE (programming language)|LFE]]
Line 389:
|
|
| <code>Base.Sequence.unfold ''~init'' ''~f''</code> <ref>{{cite web|url=https://opensource.janestreet.com/base/|title = Base|publisher = Jane Street Capital|
|
|- valign="top"
Line 472:
| <code>''list''.reduceRight(''func'')</code>
|
| Scala's symbolic fold syntax was intended to resemble the left- or right-leaning tree commonly used to explain the fold operation,<ref>{{cite newsgroup |title= Re: Blog: My verdict on the Scala language |author= Odersky, Martin |date= 2008-01-05 |newsgroup= comp.scala.lang |url= http://permalink.gmane.org/gmane.comp.lang.scala/9557 |
Scala also features the tree-like folds using the method <code>list.fold(z)(op)</code>.<ref>{{Cite web|url=https://www.scala-lang.org/api/current/scala/collection/Seq.html#fold%5BA1%3E:A%5D(z:A1)(op:(A1,A1)=%3EA1):A1|title=Fold API - Scala Standard Library|website=www.scala-lang.org|access-date=2018-04-10}}</ref>
|- valign="top"
Line 637:
|pages= 355–372
|url= http://www.cs.nott.ac.uk/~gmh/fold.pdf
|
<syntaxhighlight lang="haskell">
g = foldr f v
Line 650:
|pages= 5–16
|url= http://www.haskell.org/wikiupload/1/14/TMR-Issue6.pdf
|
<syntaxhighlight lang="haskell"> y f = foldr (\_ -> f) undefined (repeat undefined)</syntaxhighlight>
|