tail-recursion
F# tail recursion and why not write a while loop?
I\'m learning F# (new to functional programming in general though used functional aspects of C# for years but let\'s face it, that\'s pretty different) and one of the things that I\'ve read is that th[详细]
2023-03-04 16:45 分类:问答Tail-recursion and scalaz promises
I am currently playing with Scalaz non-blocking futures aka. Promises. I am struggling to make the following function tail-recursive:[详细]
2023-03-04 03:58 分类:问答Can't get my head around primitive recursion definitions in haskell
I\'ve got a good idea of what primitive recursive definitions are, however I still can\'t seem to get my head around it.[详细]
2023-03-04 01:12 分类:问答Asserting @tailrec on Option.getOrElse
In the following, the line maybeNext.map{rec}.getOrElse(n) uses the Option monad to implement the recurse or escape pattern.[详细]
2023-03-02 20:44 分类:问答Return item at position x in a list
I was reading this post While or Tail Recursion in F#, what to开发者_如何学运维 use when? were several people say that the \'functional way\' of doing things is by using maps/folds and higher order fu[详细]
2023-02-26 07:07 分类:问答Use of recursion in Scala when run in the JVM
From searching elsewhere on this site and the web, tail call optimization is not supported by the JVM. Does that therefore mean that tail recursive Scala code such as the following, which may run on v[详细]
2023-02-26 00:54 分类:问答scheme, list of functions as parameter
I\'m trying to solve this problem. I was wondering if someone would help get started on it or give me some hints.[详细]
2023-02-24 01:06 分类:问答postorder using tail recursion
i find this link, http://www.experts-exchange.com/Programming/Algorithms/Q_25205171.html, which suggests a way to do postorder tail recursion. however, it uses 2 stacks, is there a way to do this with[详细]
2023-02-19 21:42 分类:问答Converting a function with two recursive calls in scheme to make it tail-recursive
Before I start: YES, this is homework from college. Before I get told that I\'m lazy and evil: this part of the homework was to convert two functions we already had, this one is the 6th.[详细]
2023-02-19 03:29 分类:问答Why is this tail recursive?
check out this Scala-code: def rec(n: Int) { if (n > 1) { val d = n / 2 rec(d) //if (d > 1)// abort loop[详细]
2023-02-17 14:35 分类:问答