Indentation matters in Haskell!

Indentation has meaning in Haskell. Instead of using braces ({ and }) to delimit code blocks, Haskell by default uses indentation — somewhat like the Python language. By indenting the lines of a definition that belong to the same code block uniformly, the Haskell system can recognise code blocks without the syntactic noise of explicit braces.

For more details, please have a look at the section entitled "Layout" in the chapter Fundamentals of Learning Haskell.

Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.
Powered by Zendesk