functional-programming
Space leaks in Haskell
I have read it many times that lazy evaluation in Haske开发者_如何学Pythonll may sometimes lead to space leaks. What kind of code can lead to space leaks? How to detect them? And what precautions can[详细]
2023-04-13 05:16 分类:问答difference between foldLeft and reduceLeft in Scala
I have learned the basic difference between foldLeft and reduceLeft foldLeft: initial value has to be passed[详细]
2023-04-13 03:21 分类:问答some function applied with ratio never returns
can some on开发者_开发百科e please explain why (some #(= 3 %) (range)) returns true but (some #(= 4/3 %) (range))[详细]
2023-04-12 19:13 分类:问答Is there a way for easy construction of a list of repeated elements in Haskell without helper functions?
Given a tuple of type (Int, a) such as (n,c), I wish to construct a list [a] where the element c is repeated n times, i.e., (4, \'b\') becomes \"bbbb\". My current solution is the f开发者_Python百科ol[详细]
2023-04-12 10:31 分类:问答lambda constness?
c++0x supports lambdas that capture values by reference: [&] -> ret_t { return 0; } Does it make sense to capture const references?[详细]
2023-04-12 03:00 分类:问答F# map/set comprehensions
I\'m looking for something akin to the dict/list/set comprehensions in Python. In Python you can do: [x+2 for x in list if x > 10][详细]
2023-04-12 02:41 分类:问答Why isn't there an orElse method on PartialFunction that accepts a total function?
Why is there no method with following signature on class PartialFunction[A, B]? def orElse[A1 <: A, B1 >: B](that: A1 => B1): A1 => B1[详细]
2023-04-12 00:07 分类:问答char representation clojure
How can I represent a char (character) in clojure? Also I would like an example to test it using the char? function[详细]
2023-04-11 16:13 分类:问答access clojure via java classes
Hello I have a main method in a Java class and I would like to access and run my clojure functions from my java classe开发者_如何学JAVAs, is that possible right?[详细]
2023-04-11 11:53 分类:问答Data structure for trees
I noticed that Python has quite a lot specialities for working with data structures (various iterators, generators, list comprehensions etc.).[详细]
2023-04-11 04:43 分类:问答