This is a lecture using OCaml intended to demonstrate building up basic lists, then using that along with the notion of thunks to build basic streams, followed by using the intrinsic lazy type as a memoizing alternative. There is also consideration of basic applicative and functional programming ideas and brief treatment of monads.
A peripheral notion here is to using helpful tools like vim-slime or similar alongside tmux, to execute the code step by step from vim in utop to show the concepts. First install vim and tmux. To install vim-slime, first install pathogen, then install vim_slime as a pathogen bundle and add this to your .vimrc:
execute pathogen#infect()
let g:slime_target = "tmux"
let g:slime_paste_file = "$HOME/.slime_paste"
let g:slime_default_config = {"socket_name": "default", "target_pane": "0.1"}
let g:slime_dont_ask_default = 1
You can start the twin vertical view using the included vv script as such:
./vv src/code.ml
Use C-c C-c to send code paragraphs from vim to utop. You can remap the keys too, as with most any vim commands.