4 ms·
I'm not the author, and I think this was kind of a cop out, but: http://notes-on-haskell.blogspot.com/2007/02/whats-wrong-with-for-loop.html?showComment=117097
by bretthoerner 16y ago
I'm not the author, and I think this was kind of a cop out, but:
http://notes-on-haskell.blogspot.com/2007/02/whats-wrong-with-for-loop.html?showComment=1170973200000#c3703275550011546258 http://notes-on-haskell.blogspot.com/2007/02/whats-wrong-wit...
"A few people have commented that none of the examples use closures, but in Haskell closures are used not only to represent functions but also unevaluated values (i.e., thunks). For example, in the simple expression
total = sum array
the variable array is free and refers to some value, possibly unevaluated, in the enclosing environment. Until the value of total is evaluated it exists as a thunk that closes over array (and sum, for that matter).
So the examples do indeed use closures.
Cheers! ---Tom"
- colanderman 16y agoYou know, he's totally correct (Haskell being lazy and all) but I think he missed the point entirely :P