code for functional programming fundamentals lectures (Channel 9)