Skimmers Guide for Week 13 of Functional Programming for the Object-Oriented Programme

8 Jul

“A monad is a collection of functions that can be used to modify stepwise calculations.”

What did we read about?

This was our thirteenth week of ‘Functional Programming for the Object-Oriented Programmer‘ by Brian Manick.

We start from Page 121 “10 Branching and Looping in Dataflow Style” and read all the way through to Page 131 stopping at “10.5 Extending continuation-passing style”.

Going over the “->” and “let” functions again, we compare the linear/non-linear calculation of them both. We look at removing explicit branching through “monads”, which allow us to insert code after the computation steps in the normal flow of our code.

Finally we are introduced to the “continuation-passing style”, revolving around the idea of “flowing the result” of each step of our computation into the next. There are some Exercises to get you to grips with it and then we elaborate on how the style gets evaluated.

What stood out?

  • “10.1 That pesky nil again” (Page 124) – A well worked example of doing nil checking automagically via the “with-monad” and “domonad”.
  • “10.2 Continuation-passing style” (Page 126) – An interesting use of the “->” function which actually makes computation steps clearer.

If you read nothing else this week…

  • Practice the continuation-passing style in Exercises 1 – 3 (Page 127).
  • “10.4 Expansions in Evaluation” (Page 128) gets under the covers of continuation-passing style and how it gets evaluated. We compare this to how the “domonad” gets evaluated and how understanding both is critical to understanding how monads in general work.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: