Notes week of 22 Oct

  • More work on expression trees, and variable environments
  • Applicative functors
  • Assignment 7: trees, stacks, translation

We need a way to track/specify the values of variables.

Applicative functors

Review: a functor f is a type with one operation

You can use (<$>) as a symbolic infix operator for fmap.

Applicative is an extension of functor that needs two additional functions:

  (<*>) :: f (a -> b) -> f a -> f b
   fmap ::   (a -> b) -> f a -> f b

(<*>) is sometimes pronounced “splat”.