Haskell: Difference between "<-" left arrow and 'let' expressions

The syntax left arrow denoted by "<-", allows you to bind a variable from the result of an IO computation.

Saizan on freenode does a better job of explaining it...

When asked; What are the main differences between left-arrow and binding a variable with let.

"the <- arrow "extracts" the value from an IO computation, while using let you'd just define another name for the computation as a whole"

"so in let x = getChar, x :: IO Char, but in do x <- getChar; ... x :: Char"

Comments

Popular posts from this blog

Is Java the new COBOL? Yes. What does that mean, exactly? (Part 1)

On Unit Testing, Java TDD for developers to write

JVM Notebook: Basic Clojure, Java and JVM Language performance