Skip to content

Computer Science Club presentation about streams, thunks, lazy types and monads

License

Notifications You must be signed in to change notification settings

CompScienceClub/ocaml-streams-thunks-lazy-monads

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OCaml intro: thunks, streams, lazy evaluation and monads

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.

vim

tmux

pathogen

vim-slime

About

Computer Science Club presentation about streams, thunks, lazy types and monads

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages