News for hackers. Stuff that matters.
Re:Why does Haskell, in your opinion, suck? by virmundi on Sunday April 17, 2016 @10:56AM (#11514704)
Mine is that it's built on a lie. A nobel lie, but a lie none the less. In order to be pure it has "stop the world and record it" with monads to do any IO. It pretends that the world can be snapped shotted and immutable. In reality the monad is only an extra box with a belief that the world stops. The world in fact does not.
Re:Why does Haskell, in your opinion, suck? by solidsnack9000 on Sunday April 17, 2016 @01:25PM (#11515338)
The IO monad doesn't involve actually recording anything...it's not like MVCC. What are you actually trying to say here?
Re:Why does Haskell, in your opinion, suck? by virmundi on Sunday April 17, 2016 @03:58PM (#11516027)
It's that a monad looks pure, but actually isn't. Call addition with the same args and you should get the same answer. Calling next on a stream of io is destructive.
Re:Why does Haskell, in your opinion, suck? by solidsnack9000 on Sunday April 17, 2016 @06:19PM (#11516614)
> ...a monad looks pure, but actually isn't.

This is not true. The arguments for `next` include both:

* The target stream.

* A "state token" or universe.

You get different results with different state tokens.

At a high level, the thing to consider is that we can model all imperative programming with functional programming -- we can model Turing Machines with Lambda Calculus -- as well as go the other way around, because Turing Machines and the Lambda Calculus are, for all intents and purposes, equivalently expressive.

Modeling IO with state monads isn't a hack; it's the point.

Re:Why does Haskell, in your opinion, suck? by virmundi on Sunday April 17, 2016 @07:14PM (#11516787)
Thank you for the explanation. Haskell's not as bad as I thought in this respect. My understanding was IO streams were a single input function (ie the stream). As a result the destructiveness would be less obvious.

Can you replay a get from stream by passing in an older token?

Re:Why does Haskell, in your opinion, suck? by solidsnack9000 on Monday April 18, 2016 @12:50AM (#11517788)
Because the token is passed only within the implementation of `>>=`, which is private to the IO module, you never have access to it. So no need for the runtime to keep snapshots lying around.

Monads provide a way to combine them and a way to inject values into them; but not all monads provide the inspection interface that would allow you to examine that state token. The definition of a monad guarantees only the injection and the combination (the "unit" and "multiply").

Re:Why does Haskell, in your opinion, suck? by Peaker on Sunday April 17, 2016 @05:09PM (#11516324)
If you call 'next' on an IO stream, you always get the same answer, an IO effect which, when executed, would destructively get the next item:

  next :: Stream a -> IO a
The function part is pure. The `execution` of the resulting `IO a` action (which is completely separate from its pure evaluation) is not.
Re:Why does Haskell, in your opinion, suck? by tome on Sunday April 17, 2016 @12:30PM (#11515093)
Nope, that's not what it is at all. IO is "just" an effect tag.
Re:Why does Haskell, in your opinion, suck? by eveningcoffee on Sunday April 17, 2016 @01:13PM (#11515282)
Well, you can argue that you at the given moment are not the same you a moment ago.

You can perceive yourself moment ago exactly because of that.

Others who have not seen you recently hold the old reference to you.

I would rather say that the world is naturally immutable.

Re:Why does Haskell, in your opinion, suck? by oldmanmike on Sunday April 17, 2016 @03:58PM (#11516030)
> In order to be pure it has "stop the world and record it" with monads to do any IO.

That's not how IO in Haskell works, you're basically describing what Haskell would be if it literally had no side-effects ever.