Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Look at those Huskell retards and laugh

Name: Anonymous 2014-12-13 9:12

However, this comes with the caveats of using WriterT [a], which is that it will leak space like crazy for a large assembly computation (even if you don't log anything!).

This is wrong.

*Main Control.Monad> take 2 . flip evalState 0 . execWriterT $ forever (byte 4)
[4,4]


Also, when complied with -O2 then

main = print . flip evalState 0 . execWriterT $ forever (byte 4)

appears to run in constant memory.

------------------------------------------

Huh. I guess that works because the whole stack is lazy. However, if you make the base State monad strict then WriterT leaks space:

>>> import Control.Monad.Trans.Writer
>>> import Control.Monad.Trans.State.Strict
>>> import Control.Monad.Trans.Class
>>> import Control.Monad
>>> runStateT (execWriterT (forever (lift (put 1)))) 0 -- Leaks space

Name: Anonymous 2014-12-13 17:03

>>6
F# isn't lazy (by default), have fun flipping burgers while writing shitty homoerotic code at home and not understanding why you have memory leaks.

And yeah I know Microsoft isn't cool where you're from. You know, that place where people love to look down on those who get shit done. Concealing their own inadequacy with a thin layer of bitter misguided elitism. Oh glorious patrician, teach me your ways of writing shit-tier useless programs that serve no other purpose than impressing similarly misguided fools. Let's write a Scheme!

>>7
sure, PLENTY of jobs, ... perhaps an unpaid internship at Galois?

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List