...

/

Syntactic Sugar II: let and where

Syntactic Sugar II: let and where

Learn how to split complex expressions into reusable subexpressions.

Let’s continue discovering some of the syntactic sugar that Haskell offers us. In this lesson, we focus on bindings for subexpressions.

Sometimes when writing functions, the expressions on the right hand side of equations can become quite complex, especially when they involve repeated subexpressions. For example, consider the task to write a function which solves the quadratic equation

x2+px+q=0x^2 + px + q = 0 ...