Gregory Ewing <greg.ew...@canterbury.ac.nz>:

> Marko Rauhamaa wrote:
>> This suggests even the promoters of functional programming
>> intuitively prefer imperative programming, but that's ok as long as
>> it's all functional under the hood.
>
> You make it sound like functional programmers like functional
> programming because it gives them a warm fuzzy feeling. I don't think
> that's true -- there are specific reasons they like it, and those
> reason still apply when I/O is expressed using a monadic structure.
>
> Read Part 2 - I have something to say about that at the end.

I've read it. This looks awfully imperative to me:

   main = do
     putStrLn "Hi, what's your name?"
     name <- getLine
     putStrLn ("Aren't monads great, " ++ name ++ "?")

Scheme programmers have (begin ...) for sequential blocks and (do ...)
and (for-each ...) for loops.

As your Part 2 indicates, Haskell's use of monads to implement I/O is
not pure functional programming. The order of execution is significant
and functions have side effects.

Nothing wrong with any of this. I'm all for mixed paradigms.


Marko
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to