Forums before death by AOL, social media and spammers... "We can't have nice things"
|    comp.lang.forth    |    Forth programmers eat a lot of Bratwurst    |    117,951 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 116,324 of 117,951    |
|    Paul Rubin to Anton Ertl    |
|    Re: Closures    |
|    19 Mar 24 18:10:11    |
      From: no.email@nospam.invalid              anton@mips.complang.tuwien.ac.at (Anton Ertl) writes:       > And if it's required to use every argument, then eager evaluation       > (call-by-value) is equivalent to Haskell's lazy evaluation.              "required to use every argument" and "strict evaluation" are sort of the       same thing. The difference between strict and non-strict is what       happens if some of the args are not used, or only partially consumed.       With strict evaluation, passing 1/0 as an argument should raise an       error, and trying to create infinite list will run forever or exhaust       memory. With non-strict, both of those are ok, and it's only an error       if you try to actually (e.g.) print the value.              CBN and lazy evaluation are two different strategies for implementing       non-strict evaluation. If I'm using the jargon right, they have the       same denotational semantics, but different operational semantics.              > The way I have heard about Haskell programming up to now is that one       > tries to have a pure functional part, and then use monads at the       > fringes for things like I/O where pure functional code does not cut       > it. I don't see this kind of separation in the Haskell code above.              I'll try to think of better explanation for this later, but basically       monads are just a notational trick, and I think that the Jensen's       example could have been done with the State monad instead of ST. State       is purely functional and works by threading a value through a chain of       function evaluations. ST (State Transformer) does sort of the same       thing as State, but it lets you use mutable memory cells, which can be       more efficient.              > I wonder if there is a more idiomatic way of writing this stuff in       > Haskell.              I don't see one offhand, except maybe with macros or some silly thing       like that.              --- SoupGate-Win32 v1.05        * Origin: you cannot sedate... all the things you hate (1:229/2)    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca