News for hackers. Stuff that matters.
Re:The Haskell user experience by oconnore on Wednesday August 05, 2015 @12:20PM (#10010862)
I think it can be unexpected if you're used to other semantics, but the behavior of laziness is very well defined.

    > let x = [1 .. 100] :: [Int]
    > seq x () -- force the first cons
    > :sprint x
    x = 1 : _ -- we evaluated the first cons
    > foldr (\e l -> e + l) 0 x
    5050 -- printing this value forces foldr to complete
    > :sprint x
    x = [1,2,3,4,5...100] -- all conses evaluated

There are no comments on this comment yet.