Better HN
topnewbestaskshowjobs
Log inSign up

BillMryes

7 karma · joined Apr 6, 2015 (11y ago) · 3 submissions

Submissions

comment 11y ago · link · parent

To add to what rtpg says, if you look at an actual, monadic example of an IO:

  putStrLn "What is your name?"
    >> getLine >>= 
    \name -> putStrLn ("Hi, " ++ name ++ "!")
It's just a giant chain of instructions, each previous result feeding into the next. Nowhere do we assign anything, modify anything, etc. No mutation.

comment 11y ago · link · parent

Even in non-Haskell, a lazy list is a obvious possibility for that. It's not for no reason that many languages have implemented map, reduce, filter; laziness can still be pretty efficient while increasing composability and readability.

Even Java has finally been dragged into the 1960s!

comment 11y ago · link · parent

In the computer, you also have no descriptive variable names and make excessive use of gotos. This is far from a good argument.

> Haskell does support mutation, but inside of particular monads.

You are mistaken. Monads do not involve mutation; that would defeat their entire purpose. Although it's true that the monadic code is being compiled into assembly that involves mutation, just as $LANGUAGE code is being compiled into assembly that includes a lot of goto.