liveBook · Manning

Do notation

Do notation is Haskell syntax for sequencing monadic computations and binding their intermediate results in a readable, imperative-like form.

How 2 Manning books explain it

Learn Haskell by Example

Do notation, or a do block, is Haskell syntax for sequencing monadic computations and binding their intermediate results.

How it is used
Sequences IO and parser actions while passing produced values to later computations.
How deep it goes
Defines IO-block behavior first, then relates the syntax to monadic bind and Parser implementation.
Examples
Uses an echo program, a recursive numbered-input loop, monadic addition, and PNM-header parsers.
What you can do after
Apply it via Haskell IO and Parser actions to sequence work, bind results, and handle action-valued branches.

Read how Learn Haskell by Example explains do notation →

Functional Design and Architecture: Examples in Haskell

Do notation is Haskell syntax for expressing a sequence of monadic computations with implicit binding between steps.

How it is used
Simplifies sequences of monadic computations and separates functional scenarios from their eventual interpretation.
How deep it goes
Explains binding through Maybe and Free Monad examples, but defers the broader mechanics of monadic abstractions.
Examples
Uses user lookup with Maybe and a terminal script that reads and echoes two lines.
What you can do after
Apply it via Haskell do-notation to shorten monadic workflows and construct interpretable functional scenarios.

Read how Functional Design and Architecture: Examples in Haskell explains do notation →

Related concepts

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.