News for hackers. Stuff that matters.
Re:Functional programming jargon in plain English by garethrowlands on Monday July 04, 2022 @11:18AM (#31977965)
While it's true that `IO` in Haskell has a `Monad` instance, you don't really have to know that to do `IO` in Haskell. Certainly you don't need to know `Monad` in the abstract to use `IO` concretely.

I like Haskell's `do` notation, which is its syntax sugar for monads, but it's really not that bad without. For example:

    do name <- getLine
       putStrLn ("Hello " ++ name)
isn't really that much nicer than:

    getLine >>= \name-> putStrLn ("Hello " ++ name)
or even:

    getLine >>= \name->
    putStrLn ("Hello " ++ name)
The main reason that monads are important in Haskell is that programs that do IO simply are not functions in a mathematical sense. If Haskell were limited to functions, it wouldn't be able to do IO.
Re:Functional programming jargon in plain English by goto11 on Tuesday July 05, 2022 @11:22AM (#31989290)
You do need to understand the mechanics of monads in order to do even simple IO. E.g you can write:

    do name <- getLine
       putStrLn ("Hello " ++ name)
But you cant write:

    do name <- "Buddy"
       putStrLn ("Hello " ++ name)
 
You have to write:

    do let name = "Buddy"
       putStrLn ("Hello " ++ name)
Now try to explain that without basically explaining what a monad is.