lazy-evaluation
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 分类:问答Determining the extent of lazy evaluation
Given data BTree a = End Node a (BTree a) (BTree a) deriving(Show,Eq,Ord) data Msg = Msg { from :: S开发者_运维问答tring[详细]
2023-04-12 13:59 分类:问答Performance of lazy evaluation in Haskell when the arguments appear several times
Let\'s say I have a function which can calculate power of four of a number defined by let power4 x = x*x*x*x[详细]
2023-04-12 07:14 分类:问答How do I handle an infinite list of IO objects in Haskell?
I\'m writing a program that reads from a list of files.The each file either contains a link to the next file or marks that it\'s the end of the chain.[详细]
2023-04-12 03:52 分类:问答Is the use of .Net Lazy class an overkill in this case?
I learned about Lazy class in .Net recently and have been probably over-using it. I have an example below where things could have been evaluated in an eager fashion, but that would result in repeating[详细]
2023-04-11 06:28 分类:问答What's the difference between Lazy.Force() and Lazy.Value
On the MSDN documentation for Lazy.Force<T> extension method says: Forces the execution of this value and returns its result. Same as[详细]
2023-04-08 05:46 分类:问答How pure and lazy can Scala be?
This is just one of those \"I was wondering...\" questions. Scala has immutable data 开发者_如何学Pythonstructures and (optional) lazy vals etc.[详细]
2023-04-07 20:21 分类:问答What's the difference between lazy loading and lazy evaluation?
Is there a difference between \"lazy loading\" and \"lazy evaluation\" (both of which are tags on Stack Overflow), or are they synonymous?[详细]
2023-04-07 12:00 分类:问答Pattern matching and infinite streams
So, I\'m working to teach myself Scala, and one of the things I\'ve been playing with is the Stream class. I tried to use a naïve translation of the classic Haskell version of Dijkstra\'s solution to[详细]
2023-04-06 11:46 分类:问答What are Haskell's strictness points?
We all know (or should know) that Haskell is lazy by default. Nothing is evaluated until it must be evaluated. So when must something be evaluated? There are points where Haskell must be strict. I cal[详细]
2023-04-06 01:01 分类:问答