├── lectures ├── .merlin ├── lec02_why_fp │ ├── images │ │ ├── wut.jpg │ │ └── ocaml.png │ └── lec2_why_functional_programming.ipynb ├── lec05_datatypes │ └── images │ │ └── box.jpg ├── lec08_lambda_syntax │ ├── images │ │ ├── church.jpg │ │ ├── godel.jpg │ │ └── turing.jpg │ └── init.ml ├── lec13_modular_programming │ └── modules.png ├── lec09_lambda_semantics │ ├── images │ │ └── church_rosser.png │ └── init.ml ├── lec01_first_day_of_classes │ └── images │ │ ├── alan-perlis.jpg │ │ └── hello-different-languages.jpg ├── lec07_higher_order_programming │ ├── images │ │ ├── star_trek.png │ │ ├── map_reduce_new_yorker.png │ │ ├── fold_right.svg │ │ ├── sum_fold.svg │ │ └── list_shape.svg │ └── drawings │ │ ├── list_shape.drawio │ │ ├── fold_right.drawio │ │ └── sum_fold.drawio ├── lec19_mutable_data_structures │ ├── queue.pl │ └── stack.pl ├── lec17_lists │ └── list.pl ├── lec10_lambda_encodings │ └── init.ml ├── lec03_expressions │ ├── drawings │ │ ├── val-expr.drawio │ │ └── val-expr-defn.drawio │ └── images │ │ ├── val-expr.svg │ │ └── val-expr-defn.svg ├── lec12_side_effects │ ├── heap2 │ ├── heap2.drawio │ ├── heap.drawio │ ├── heap2.svg │ └── heap.svg └── lec04_functions │ ├── drawings │ ├── stack1.drawio │ └── stack2.drawio │ └── images │ ├── stack1.svg │ └── stack2.svg ├── .gitignore ├── lambda ├── alpha.cmi ├── alpha.cmo ├── alpha.cmt ├── error.cmi ├── error.cmo ├── error.cmt ├── eval.cmi ├── eval.cmo ├── eval.cmt ├── lambda.cmi ├── lambda.cmo ├── lambda.cmt ├── syntax.cmi ├── syntax.cmo ├── syntax.cmt ├── lambda_lexer.cmi ├── lambda_lexer.cmo ├── lambda_lexer.cmt ├── lambda_parse.cmi ├── lambda_parse.cmo ├── lambda_parse.cmt ├── lambda_parser.cmi ├── lambda_parser.cmo ├── lambda_parser.cmt └── lambda_parser.cmti ├── assets └── favicon.ico ├── _images ├── paradigms.png ├── snapshot.png ├── fabulous-sylvester.jpg ├── stand-and-deliver.jpg ├── stand-and-deliver-fb.jpg └── stand-and-deliver-crop.jpg ├── Gemfile ├── _docker ├── .ipynb_checkpoints │ └── Untitled-checkpoint.ipynb ├── .ocamlinit └── dockerfile ├── _data ├── lectures.yml └── menu.yml ├── _includes ├── embedpdf.html ├── image.html ├── nav.html ├── head.html ├── footer.html └── header.html ├── assignments ├── assignment2 │ └── init.ml └── assignment0 │ └── assignment0.ipynb ├── _layouts ├── page.html ├── default.html ├── class.html └── post.html ├── ipa.gemspec ├── _config.yml ├── _sass ├── _fancy-image.scss ├── _mobile-header.scss ├── _syntax-highlighting.scss ├── _base.scss ├── _header.scss └── _layout.scss ├── sitemap.xml ├── LICENSE ├── _posts └── 2015-08-16-welcome-to-jekyll.md ├── feed.xml ├── _css └── main.scss ├── resources.md ├── README.md ├── index.md ├── assignments.md ├── schedule.md └── Gemfile.lock /lectures/.merlin: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | *.ipynb_checkpoints 3 | *.swp 4 | _site 5 | .env 6 | -------------------------------------------------------------------------------- /lambda/alpha.cmi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kayceesrk/cs3100_m25/HEAD/lambda/alpha.cmi -------------------------------------------------------------------------------- /lambda/alpha.cmo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kayceesrk/cs3100_m25/HEAD/lambda/alpha.cmo -------------------------------------------------------------------------------- /lambda/alpha.cmt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kayceesrk/cs3100_m25/HEAD/lambda/alpha.cmt -------------------------------------------------------------------------------- /lambda/error.cmi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kayceesrk/cs3100_m25/HEAD/lambda/error.cmi -------------------------------------------------------------------------------- /lambda/error.cmo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kayceesrk/cs3100_m25/HEAD/lambda/error.cmo -------------------------------------------------------------------------------- /lambda/error.cmt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kayceesrk/cs3100_m25/HEAD/lambda/error.cmt -------------------------------------------------------------------------------- /lambda/eval.cmi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kayceesrk/cs3100_m25/HEAD/lambda/eval.cmi -------------------------------------------------------------------------------- /lambda/eval.cmo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kayceesrk/cs3100_m25/HEAD/lambda/eval.cmo -------------------------------------------------------------------------------- /lambda/eval.cmt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kayceesrk/cs3100_m25/HEAD/lambda/eval.cmt -------------------------------------------------------------------------------- /assets/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kayceesrk/cs3100_m25/HEAD/assets/favicon.ico -------------------------------------------------------------------------------- /lambda/lambda.cmi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kayceesrk/cs3100_m25/HEAD/lambda/lambda.cmi -------------------------------------------------------------------------------- /lambda/lambda.cmo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kayceesrk/cs3100_m25/HEAD/lambda/lambda.cmo -------------------------------------------------------------------------------- /lambda/lambda.cmt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kayceesrk/cs3100_m25/HEAD/lambda/lambda.cmt -------------------------------------------------------------------------------- /lambda/syntax.cmi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kayceesrk/cs3100_m25/HEAD/lambda/syntax.cmi -------------------------------------------------------------------------------- /lambda/syntax.cmo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kayceesrk/cs3100_m25/HEAD/lambda/syntax.cmo -------------------------------------------------------------------------------- /lambda/syntax.cmt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kayceesrk/cs3100_m25/HEAD/lambda/syntax.cmt -------------------------------------------------------------------------------- /_images/paradigms.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kayceesrk/cs3100_m25/HEAD/_images/paradigms.png -------------------------------------------------------------------------------- /_images/snapshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kayceesrk/cs3100_m25/HEAD/_images/snapshot.png -------------------------------------------------------------------------------- /lambda/lambda_lexer.cmi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kayceesrk/cs3100_m25/HEAD/lambda/lambda_lexer.cmi -------------------------------------------------------------------------------- /lambda/lambda_lexer.cmo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kayceesrk/cs3100_m25/HEAD/lambda/lambda_lexer.cmo -------------------------------------------------------------------------------- /lambda/lambda_lexer.cmt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kayceesrk/cs3100_m25/HEAD/lambda/lambda_lexer.cmt -------------------------------------------------------------------------------- /lambda/lambda_parse.cmi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kayceesrk/cs3100_m25/HEAD/lambda/lambda_parse.cmi -------------------------------------------------------------------------------- /lambda/lambda_parse.cmo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kayceesrk/cs3100_m25/HEAD/lambda/lambda_parse.cmo -------------------------------------------------------------------------------- /lambda/lambda_parse.cmt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kayceesrk/cs3100_m25/HEAD/lambda/lambda_parse.cmt -------------------------------------------------------------------------------- /lambda/lambda_parser.cmi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kayceesrk/cs3100_m25/HEAD/lambda/lambda_parser.cmi -------------------------------------------------------------------------------- /lambda/lambda_parser.cmo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kayceesrk/cs3100_m25/HEAD/lambda/lambda_parser.cmo -------------------------------------------------------------------------------- /lambda/lambda_parser.cmt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kayceesrk/cs3100_m25/HEAD/lambda/lambda_parser.cmt -------------------------------------------------------------------------------- /lambda/lambda_parser.cmti: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kayceesrk/cs3100_m25/HEAD/lambda/lambda_parser.cmti -------------------------------------------------------------------------------- /_images/fabulous-sylvester.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kayceesrk/cs3100_m25/HEAD/_images/fabulous-sylvester.jpg -------------------------------------------------------------------------------- /_images/stand-and-deliver.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kayceesrk/cs3100_m25/HEAD/_images/stand-and-deliver.jpg -------------------------------------------------------------------------------- /_images/stand-and-deliver-fb.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kayceesrk/cs3100_m25/HEAD/_images/stand-and-deliver-fb.jpg -------------------------------------------------------------------------------- /_images/stand-and-deliver-crop.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kayceesrk/cs3100_m25/HEAD/_images/stand-and-deliver-crop.jpg -------------------------------------------------------------------------------- /lectures/lec02_why_fp/images/wut.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kayceesrk/cs3100_m25/HEAD/lectures/lec02_why_fp/images/wut.jpg -------------------------------------------------------------------------------- /lectures/lec02_why_fp/images/ocaml.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kayceesrk/cs3100_m25/HEAD/lectures/lec02_why_fp/images/ocaml.png -------------------------------------------------------------------------------- /lectures/lec05_datatypes/images/box.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kayceesrk/cs3100_m25/HEAD/lectures/lec05_datatypes/images/box.jpg -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | source "https://rubygems.org" 4 | gem "github-pages", group: :jekyll_plugins 5 | gemspec 6 | -------------------------------------------------------------------------------- /_docker/.ipynb_checkpoints/Untitled-checkpoint.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [], 3 | "metadata": {}, 4 | "nbformat": 4, 5 | "nbformat_minor": 2 6 | } 7 | -------------------------------------------------------------------------------- /lectures/lec08_lambda_syntax/images/church.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kayceesrk/cs3100_m25/HEAD/lectures/lec08_lambda_syntax/images/church.jpg -------------------------------------------------------------------------------- /lectures/lec08_lambda_syntax/images/godel.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kayceesrk/cs3100_m25/HEAD/lectures/lec08_lambda_syntax/images/godel.jpg -------------------------------------------------------------------------------- /lectures/lec08_lambda_syntax/images/turing.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kayceesrk/cs3100_m25/HEAD/lectures/lec08_lambda_syntax/images/turing.jpg -------------------------------------------------------------------------------- /lectures/lec13_modular_programming/modules.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kayceesrk/cs3100_m25/HEAD/lectures/lec13_modular_programming/modules.png -------------------------------------------------------------------------------- /lectures/lec09_lambda_semantics/images/church_rosser.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kayceesrk/cs3100_m25/HEAD/lectures/lec09_lambda_semantics/images/church_rosser.png -------------------------------------------------------------------------------- /lectures/lec01_first_day_of_classes/images/alan-perlis.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kayceesrk/cs3100_m25/HEAD/lectures/lec01_first_day_of_classes/images/alan-perlis.jpg -------------------------------------------------------------------------------- /lectures/lec07_higher_order_programming/images/star_trek.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kayceesrk/cs3100_m25/HEAD/lectures/lec07_higher_order_programming/images/star_trek.png -------------------------------------------------------------------------------- /lectures/lec19_mutable_data_structures/queue.pl: -------------------------------------------------------------------------------- 1 | setup(q(X,X)). 2 | enter(A, q(X,Y), q(X,Z)) :- Y = [A | Z]. 3 | leave(A, q(X,Z), q(Y,Z)) :- X = [A | Y]. 4 | wrapup(q([],[])). 5 | -------------------------------------------------------------------------------- /lectures/lec19_mutable_data_structures/stack.pl: -------------------------------------------------------------------------------- 1 | setup(s(X,X)). 2 | enter(A, s(X,Z), s(Y,Z)) :- Y = [A | X]. 3 | leave(A, s(X,Z), s(Y,Z)) :- X = [A | Y]. 4 | wrapup(s([],[])). 5 | -------------------------------------------------------------------------------- /_data/lectures.yml: -------------------------------------------------------------------------------- 1 | - title: "Sample .Rmd File" 2 | filename: Untitled 3 | dirname: untitled-lecture 4 | tldr: "This is just a sample .rmd file to illustrate the use of the lectures.yml file." -------------------------------------------------------------------------------- /lectures/lec01_first_day_of_classes/images/hello-different-languages.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kayceesrk/cs3100_m25/HEAD/lectures/lec01_first_day_of_classes/images/hello-different-languages.jpg -------------------------------------------------------------------------------- /lectures/lec07_higher_order_programming/images/map_reduce_new_yorker.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kayceesrk/cs3100_m25/HEAD/lectures/lec07_higher_order_programming/images/map_reduce_new_yorker.png -------------------------------------------------------------------------------- /_docker/.ocamlinit: -------------------------------------------------------------------------------- 1 | let () = 2 | try Topdirs.dir_directory (Sys.getenv "OCAML_TOPLEVEL_PATH") 3 | with Not_found -> () 4 | ;; 5 | 6 | #use "topfind" ;; 7 | Topfind.log := ignore ;; (* prevent noisy logs *) 8 | -------------------------------------------------------------------------------- /lectures/lec17_lists/list.pl: -------------------------------------------------------------------------------- 1 | append([],L2,L2). 2 | append([H | T1], L2, [H | L]) :- append(T1, L2, L). 3 | 4 | prefix(X,Z) :- append(X,Y,Z). 5 | suffix(Y,Z) :- append(X,Y,Z). 6 | 7 | last([H],H). 8 | last([_|T],X) :- last(T,X). 9 | -------------------------------------------------------------------------------- /lectures/lec10_lambda_encodings/init.ml: -------------------------------------------------------------------------------- 1 | #directory "/cs3100_iitm/lambda";; 2 | #load_rec "/cs3100_iitm/lambda/syntax.cmo";; 3 | #load_rec "/cs3100_iitm/lambda/lambda_parse.cmo";; 4 | #load_rec "/cs3100_iitm/lambda/eval.cmo";; 5 | 6 | open Syntax 7 | -------------------------------------------------------------------------------- /_includes/embedpdf.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /assignments/assignment2/init.ml: -------------------------------------------------------------------------------- 1 | #directory "/cs3100_iitm/lambda";; 2 | #load_rec "/cs3100_iitm/lambda/syntax.cmo";; 3 | #load_rec "/cs3100_iitm//lambda/lambda_parse.cmo";; 4 | #load_rec "/cs3100_iitm//lambda/alpha.cmo";; 5 | 6 | let alpha_equiv = Alpha.alpha_equiv 7 | -------------------------------------------------------------------------------- /_includes/image.html: -------------------------------------------------------------------------------- 1 |
2 | 3 |
{{ include.caption }}
4 | 5 |
{{ include.caption }}
6 |
7 | -------------------------------------------------------------------------------- /_layouts/page.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | --- 4 |
5 | 6 |
7 |

{{ page.title }}

8 |
9 | 10 |
11 | {{ content }} 12 |
13 | 14 |
15 | -------------------------------------------------------------------------------- /_data/menu.yml: -------------------------------------------------------------------------------- 1 | - title: "About" 2 | href: "/about/" 3 | 4 | - title: "Blog" 5 | href: "/blog/" 6 | 7 | - title: "CV" 8 | href: "/cv/" 9 | 10 | - title: "Miscellany" 11 | href: "/miscellany/" 12 | subcategories: 13 | - subtitle: "Item 1" 14 | subhref: "/miscellany/item-1/" 15 | - subtitle: "Item 2" 16 | subhref: "/miscellany/item-2/" 17 | -------------------------------------------------------------------------------- /_layouts/default.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {% include head.html %} 5 | 6 | 7 | 8 | {% include header.html %} 9 | 10 |
11 |
12 | {{ content }} 13 |
14 |
15 | 16 | {% include footer.html %} 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /_layouts/class.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | --- 4 | 5 | 6 |
7 |

{{ page.title }}

8 |
9 | 10 |
11 |
12 | {{ content }} 13 |
14 | 15 |
16 | 17 |
18 | 19 | {% include_relative {{page.path | remove:'.md' | remove: 'teaching' | append:'-course-materials.md'}} %} 20 | 21 |
22 | -------------------------------------------------------------------------------- /_layouts/post.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | --- 4 |
5 | 6 |
7 |

{{ page.title }}

8 | 17 |
18 | 19 |
20 | {{ content }} 21 |
22 | 23 |
24 | -------------------------------------------------------------------------------- /ipa.gemspec: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | Gem::Specification.new do |spec| 4 | spec.name = "ipa" 5 | spec.version = "0.1.0" 6 | spec.authors = ["KC Sivaramakrishnan"] 7 | spec.email = ["kc@kcsrk.info"] 8 | 9 | spec.summary = "CS3100 IITM Theme" 10 | spec.homepage = "http://cs3100_m25.github.io" 11 | spec.license = "MIT" 12 | 13 | spec.files = `git ls-files -z`.split("\x0").select { |f| f.match(%r{^(assets|_layouts|_includes|_sass|LICENSE|README)}i) } 14 | 15 | spec.add_runtime_dependency "jekyll", "~> 3.6" 16 | 17 | spec.add_development_dependency "rake", "~> 12.3" 18 | end 19 | -------------------------------------------------------------------------------- /lectures/lec09_lambda_semantics/init.ml: -------------------------------------------------------------------------------- 1 | #require "str";; 2 | #directory "/cs3100_iitm/lambda";; 3 | #load_rec "/cs3100_iitm/lambda/syntax.cmo";; 4 | #load_rec "/cs3100_iitm/lambda/lambda_parse.cmo";; 5 | #load_rec "/cs3100_iitm/lambda/eval.cmo";; 6 | 7 | open Syntax 8 | 9 | let eval_cbv ?(log=false) s = s |> Lambda_parse.parse_string |> Eval.eval ~log Eval.reduce_cbv |> Syntax.string_of_expr 10 | let eval_cbn ?(log=false) s = s |> Lambda_parse.parse_string |> Eval.eval ~log Eval.reduce_cbn |> Syntax.string_of_expr 11 | let eval_normal ?(log=false) s = s |> Lambda_parse.parse_string |> Eval.eval ~log Eval.reduce_normal |> Syntax.string_of_expr 12 | -------------------------------------------------------------------------------- /_includes/nav.html: -------------------------------------------------------------------------------- 1 | 10 | -------------------------------------------------------------------------------- /lectures/lec08_lambda_syntax/init.ml: -------------------------------------------------------------------------------- 1 | #require "str";; 2 | #directory "/cs3100_iitm/lambda";; 3 | #load_rec "/cs3100_iitm/lambda/syntax.cmo";; 4 | #load_rec "/cs3100_iitm/lambda/lambda_parse.cmo";; 5 | #load_rec "/cs3100_iitm/lambda/eval.cmo";; 6 | 7 | open Syntax 8 | 9 | let parse = Lambda_parse.parse_string 10 | 11 | let free_variables s = 12 | s |> Lambda_parse.parse_string |> Eval.free_variables |> Eval.SS.elements 13 | 14 | let substitute expr a b = 15 | let expr = Lambda_parse.parse_string expr in 16 | let b = Lambda_parse.parse_string b in 17 | Eval.substitute expr a b |> Syntax.string_of_expr 18 | 19 | (* 20 | let eval s = s |> Lambda_parse.parse_string |> Eval.eval |> Syntax.string_of_expr 21 | let eval_traced s = s |> Lambda_parse.parse_string |> Eval.eval ~log:true |> Syntax.string_of_expr 22 | *) 23 | -------------------------------------------------------------------------------- /_config.yml: -------------------------------------------------------------------------------- 1 | # Site settings 2 | title: CS3100 Monsoon 2025 3 | subtitle: Paradigms of Programming 4 | baseurl: "/cs3100_m25" # the subpath of your site, e.g. /blog/ 5 | url: "http://kayceesrk.github.io" # the base hostname & protocol for your site 6 | syllabus: "http://www.cse.iitm.ac.in/course_details.php?arg=MTk=" 7 | githubdir: "kayceesrk/cs3100_m25" 8 | 9 | # Author/user information 10 | email: kcsrk@iitm.ac.in 11 | twitter_username: kc_srk 12 | github_username: kayceesrk 13 | authorurl: "http://kcsrk.info" 14 | address: | 15 | Department of Computer Science and Engineering 16 | SSB 413, Indian Institute of Technology, Madras 17 | Chennai, India 600036 18 | 19 | # Build settings 20 | markdown: kramdown 21 | 22 | # Other options 23 | permalink: blog/:year/:month/:title 24 | excerpt_separator: "" 25 | 26 | include: ['_images', '_css'] 27 | -------------------------------------------------------------------------------- /_sass/_fancy-image.scss: -------------------------------------------------------------------------------- 1 | .wp-caption { 2 | background-color: #f3f3f3; 3 | text-align: center; 4 | border: 1px dotted $clemson-purple; 5 | font-size: 0.90em; 6 | overflow: hidden; 7 | position: relative; 8 | 9 | } 10 | 11 | .wp-caption dd { 12 | color: #000000; 13 | background-color: #f3f3f3; 14 | font-size: .9em; 15 | padding: 2px 8px 3px 8px; 16 | margin: 1px 0 0 0; 17 | } 18 | 19 | .wp-caption dt { 20 | margin: 0; 21 | } 22 | 23 | .wp-caption img { 24 | display: block; 25 | margin: 0; 26 | padding: 0; 27 | border: 0; 28 | } 29 | 30 | 31 | .alignleft, 32 | .alignright { 33 | margin-top: 4px; 34 | } 35 | .alignleft { 36 | float: left; 37 | margin-right: 20px; 38 | margin-bottom: 15px; 39 | } 40 | .alignright { 41 | float: right; 42 | margin-left: 20px; 43 | margin-bottom: 15px; 44 | } 45 | .aligncenter { 46 | display: block; 47 | margin-left: auto; 48 | margin-right: auto; 49 | } 50 | -------------------------------------------------------------------------------- /lectures/lec03_expressions/drawings/val-expr.drawio: -------------------------------------------------------------------------------- 1 | tVRdT4MwFP01PJrYMjt41DmdMT4t0eiL6eAC1UKxdIP5672Mlo9ME03cC7Tn3Hvb3nNaz1/kza3mZfagYpAePY8bz7/2KA1nDL8tsO8AFtAOSLWIO4gMwFp8ggXPLboVMVSTQKOUNKKcgpEqCojMBONaq3oalig5XbXkKRwB64jLY/RJxCbr0IDOB3wFIs3cyoSFHZNzF2xPUmU8VvUI8peev9BKmW6UNwuQbe9cX7q8mx/YfmMaCvObhPo+lG+vNXt+We9Wr3fpy/2KntkqOy639sAeZRLrXSUKy+Kuzd62gn1slSPOqoNQlxhAgrIZSByl9n+ostGnR5ZNqaGqhCoqR2IXuv27HDo5CsXOoIFwclVnwsC65FHL1GhhxDKTS5yR9rBCyoWSSh/y/JhDkESIV0ardxgxLApgk7SMk5n0C+9AG2h+lI30ZsBLBCoHo/cY4hLm1j/2AhHfzuvBjn1MNrIinVmQ2yuQ9rUHl+DAGuUPpqEnMs1jW/DkGgKJL2D+nYYhm/uc/Y9s/QPmZGPHsoXfqEbI31XD6fCMHLjRW+wvvwA= -------------------------------------------------------------------------------- /lectures/lec03_expressions/drawings/val-expr-defn.drawio: -------------------------------------------------------------------------------- 1 | vVVNb6MwEP01HCvVduvAcZtmm1XVU6RW20vlwADuGkyNE8j++h2CDUFJpV1p6QU8bz5sz3sDAVsW7YMRVf6kE1ABvU7agN0HlEY3HJ8dcOgBHtIeyIxMeoiMwEb+BgdeO3QnE6gngVZrZWU1BWNdlhDbCSaM0c00LNVqumslMjgDNrFQ5+iLTGzeoyFdjPgaZJb7nQmPek8hfLC7SZ2LRDcnEFsFbGm0tv2qaJegut75vvR53z/xDgczUNq/SWgeI/X+1vCfr5v9+u1H9vq4pleuyl6onbtwQLnCenepxrJ4antwreAfO+0dV/WRqG8YQMKqHZ24ytz7WGVr5kdWbWWgrqUua+/ELvTn9zl0chWKnUEBoXHX5NLCphJx52lQwojltlBoke6yUqmlVtoc81giIExjxGtr9C848fA4hG3aeTzNZNh4D8ZC+yltZBADDhHoAqw5YIhPWDj9uAEizNnNKMchJj+RIr1xoHAjkA21R5XgwgnlH0RDZxLNc1dwdg6BJLewuMRhxBdM8P9D2/AB87Txc9qiC6wRMhdrbCbW7iGVpbRfMX5pmtL44vglfMtv+Qzjx75y/NAc/wdH38lPla3+AA== -------------------------------------------------------------------------------- /sitemap.xml: -------------------------------------------------------------------------------- 1 | --- 2 | layout: null 3 | sitemap: 4 | exclude: 'yes' 5 | --- 6 | 7 | 8 | {% for post in site.posts %} 9 | {% unless post.published == false %} 10 | 11 | {{ site.url }}{{ post.url }} 12 | {% if post.sitemap.lastmod %} 13 | {{ post.sitemap.lastmod | date: "%Y-%m-%d" }} 14 | {% elsif post.date %} 15 | {{ post.date | date_to_xmlschema }} 16 | {% else %} 17 | {{ site.time | date_to_xmlschema }} 18 | {% endif %} 19 | {% if post.sitemap.changefreq %} 20 | {{ post.sitemap.changefreq }} 21 | {% else %} 22 | monthly 23 | {% endif %} 24 | {% if post.sitemap.priority %} 25 | {{ post.sitemap.priority }} 26 | {% else %} 27 | 0.5 28 | {% endif %} 29 | 30 | {% endunless %} 31 | {% endfor %} 32 | 33 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Steven V. Miller 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /_posts/2015-08-16-welcome-to-jekyll.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: post 3 | title: "Welcome to Jekyll!" 4 | date: 2015-08-16 15:36:27 5 | categories: jekyll update 6 | --- 7 | You’ll find this post in your `_posts` directory. Go ahead and edit it and re-build the site to see your changes. You can rebuild the site in many different ways, but the most common way is to run `jekyll serve`, which launches a web server and auto-regenerates your site when a file is updated. 8 | 9 | To add new posts, simply add a file in the `_posts` directory that follows the convention `YYYY-MM-DD-name-of-post.ext` and includes the necessary front matter. Take a look at the source for this post to get an idea about how it works. 10 | 11 | Jekyll also offers powerful support for code snippets: 12 | 13 | {% highlight ruby %} 14 | def print_hi(name) 15 | puts "Hi, #{name}" 16 | end 17 | print_hi('Tom') 18 | #=> prints 'Hi, Tom' to STDOUT. 19 | {% endhighlight %} 20 | 21 | Check out the [Jekyll docs][jekyll] for more info on how to get the most out of Jekyll. File all bugs/feature requests at [Jekyll’s GitHub repo][jekyll-gh]. If you have questions, you can ask them on [Jekyll’s dedicated Help repository][jekyll-help]. 22 | 23 | [jekyll]: http://jekyllrb.com 24 | [jekyll-gh]: https://github.com/jekyll/jekyll 25 | [jekyll-help]: https://github.com/jekyll/jekyll-help 26 | -------------------------------------------------------------------------------- /feed.xml: -------------------------------------------------------------------------------- 1 | --- 2 | layout: null 3 | --- 4 | 5 | 6 | 7 | {{ site.title | xml_escape }} 8 | {{ site.description | xml_escape }} 9 | {{ site.url }}{{ site.baseurl }}/ 10 | 11 | {{ site.time | date_to_rfc822 }} 12 | {{ site.time | date_to_rfc822 }} 13 | Jekyll v{{ jekyll.version }} 14 | {% for post in site.posts limit:10 %} 15 | 16 | {{ post.title | xml_escape }} 17 | {{ post.content | xml_escape }} 18 | {{ post.date | date_to_rfc822 }} 19 | {{ post.url | prepend: site.baseurl | prepend: site.url }} 20 | {{ post.url | prepend: site.baseurl | prepend: site.url }} 21 | {% for tag in post.tags %} 22 | {{ tag | xml_escape }} 23 | {% endfor %} 24 | {% for cat in post.categories %} 25 | {{ cat | xml_escape }} 26 | {% endfor %} 27 | 28 | {% endfor %} 29 | 30 | 31 | -------------------------------------------------------------------------------- /lectures/lec12_side_effects/heap2: -------------------------------------------------------------------------------- 1 | 7ZnZUtswFIafJpfpeI99CYHSoS1d6AzQm46w5aVVLFdWEoenR7akeM0CxIZM68wE6ddiSd+RzhEZ6dNZdkFAEn7GHkQjTfGykX420jTHsNh3Lqy4YNkaFwISeVxSS+E6eoBCVIQ6jzyY1ipSjBGNkrro4jiGLq1pgBC8rFfzMaq/NQEBbAnXLkBt9SbyaMhVW5uU+gcYBaF8s2o5vGQGZGUxkzQEHl5WJP18pE8JxpSnZtkUonzt5Lrwdu83lK4HRmBM92lwY8PYuvql3ShwoS9DQ3evvo9V0c0CoLmYsRgtXcklgB5bEZHFhIY4wDFA56V6SvA89mD+HoXlyjqfME6YqDLxN6R0JfCCOcVMCukMidL2XMS4UjwnLtwyAcEhH2OloViBC4hnkJIVq0AgAjRa1KkCYRzBut666VccsaFoirBjXVIUZqzZSr0LCkgAqWhVUmCJyjBKqWDzFE76kXOyh+FkGK/MSXvbnPj0t0xAH4bTmovgpFsNTtyg+uNkdHCyEFuZUx8XAy2BWX/nWBaM02LJT1gFzUiyspClgvxvJrthw+I9cb1tBQgxH5bTXoYRhdcJKPbPknnROkuQJtyx+VGW28SpHyE0xQiToiPd96HlukxPKcF/YKXEmzj3iiJGXtGV4slbSJe01WYWkFCYbbUGSVWvU1Vlflm6TlNIYcVrmspm+6mRfzJmsyfMD/8y5vVmfTOYrZ4w51HofpzLI1vdzbqJ1sw/XWit4mmj5U8fO9gx62jt10Zr7+FQY+8kD/VZzkUgTSO3vtwwi+htJX1XSZ9lwssWmZXMxGzst9VM3kZ5p5kyX7YrcrLh8wMk6ZF2emhp7Dtd9J7IXurJG2e+sacn3xkSGOrAoZtzOEtTnm5p6nCWZv63tFe1NO3YL3OyYu+37kndGxmmOSyorlvC8KBKb1Q5Fu6qhQc/I+REeydsNu6BTm9b0XCyLxeXGYE/Po7jS82///ZTHXftxEMEjqsjvx+0IsYOM9oYRJpKI4gc8H7QSbmvy/4xXg9eRLb577UhrwedZCcHiNleFoE1Tsidx+22Y6gakW025LcSf7ED5DDxV8s8nn3os2z5gwqvXv4qpZ8/Ag== -------------------------------------------------------------------------------- /lectures/lec07_higher_order_programming/drawings/list_shape.drawio: -------------------------------------------------------------------------------- 1 | 7VpbU6MwFP41POqQhOvjett92ItuH1YfY4lAh5IuTQv1128wSYEGK93WQh1nHE0+Ejj5zjnfSUADXU6LrxmeRT9oQBIDmkFhoCsDQt9y+O8SWAnA8aAAwiwOBAQqYBQ/EwmaEl3EAZk3BjJKExbPmuCYpikZswaGs4zmzWFPNGk+dYZDogGjMU509E8csEigHnQr/BuJw0g9GTi+uDLFarBcyTzCAc1rELo20GVGKROtaXFJkpI7xYuYd/PK1bVhGUlZlwl/f3p3NjjLbyc3k18puXv+nS/PLHGXJU4WcsHSWLZSDGR0kQakvIlpoAuasYiGNMXJd0pnHAQcnBDGVtJ3eMEohyI2TeRVcUcSaERXlktoThfZmGwxV1rHcBYStmUcWvPL45LQKWHZis/LSIJZvGzagWWEhOtxFYm8IXncgVNXo7Bc+0h2U5ryPxd7s0qKmN3X2g+19lUh7/vSWalOyld3X+881DvVpJeemtWD95w+vQdbMsJJuLkXj7wRlg0DfSl/JMyfUl3RPJ8kXKlKh+dRzMhohl8YyrlWNt2J5zMhX09xUYaFvNWSZIwU25nXmZIToC2lR2ovUFKUV0qGJBTVRExhB+cWadyCgTEGNhhze2YMeJ9iskUkOogJ2LcWyKm3NOYmriMFoWakaCEgDJOzNqJgbcb/B4bzgWTKH1jSeUfYFKmMMztnXPfceTMn/F1y7OCpA3373DVthGzHBQhYrtV0v2+duy6CFrA8ZJoAOc0HCKvfLbF8zfm69wdV1aGqEb3VKHCEfDlg5QCoa+mw9oz//WhtibvP0r+bA+1eHahvd0+2RiPoDUx09DcXaFiUQW+DMqdnytoK2SAE5ZDSYHeUhtecdyRpsD+QNDgDi3PQdjY6pf374aIcuHtG+SuHXxdt28Ejs9cdPHA1/1sDS5mNaopUyPaWMvqp57RS5m29V19h3nxJvW9haE8ZS+0Glcut4yaFWn/Nw/bAkkJ9OVMM9V1H2lRjEPul3g9g3bOu1w9xsO3FxInusixzIzvUcae37OhyurX50k3DvjoBfq2Nkvx+6sO71Vd/oe/Vv06g638= -------------------------------------------------------------------------------- /lectures/lec12_side_effects/heap2.drawio: -------------------------------------------------------------------------------- 1 | 7ZnZUtswFIafJpfpeI99CYHSoS1d6AzQm46w5aVVLFdWEoenR7akeM0CxIZM68wE6ddiSd+RzhEZ6dNZdkFAEn7GHkQjTfGykX420jTHsNh3Lqy4YNkaFwISeVxSS+E6eoBCVIQ6jzyY1ipSjBGNkrro4jiGLq1pgBC8rFfzMaq/NQEBbAnXLkBt9SbyaMhVW5uU+gcYBaF8s2o5vGQGZGUxkzQEHl5WJP18pE8JxpSnZtkUonzt5Lrwdu83lK4HRmBM92lwY8PYuvql3ShwoS9DQ3evvo9V0c0CoLmYsRgtXcklgB5bEZHFhIY4wDFA56V6SvA89mD+HoXlyjqfME6YqDLxN6R0JfCCOcVMCukMidL2XMS4UjwnLtwyAcEhH2OloViBC4hnkJIVq0AgAjRa1KkCYRzBut666VccsaFoirBjXVIUZqzZSr0LCkgAqWhVUmCJyjBKqWDzFE76kXOyh+FkGK/MSXvbnPj0t0xAH4bTmovgpFsNTtyg+uNkdHCyEFuZUx8XAy2BWX/nWBaM02LJT1gFzUiyspClgvxvJrthw+I9cb1tBQgxH5bTXoYRhdcJKPbPknnROkuQJtyx+VGW28SpHyE0xQiToiPd96HlukxPKcF/YKXEmzj3iiJGXtGV4slbSJe01WYWkFCYbbUGSVWvU1Vlflm6TlNIYcVrmspm+6mRfzJmsyfMD/8y5vVmfTOYrZ4w51HofpzLI1vdzbqJ1sw/XWit4mmj5U8fO9gx62jt10Zr7+FQY+8kD/VZzkUgTSO3vtwwi+htJX1XSZ9lwssWmZXMxGzst9VM3kZ5p5kyX7YrcrLh8wMk6ZF2emhp7Dtd9J7IXurJG2e+sacn3xkSGOrAoZtzOEtTnm5p6nCWZv63tFe1NO3YL3OyYu+37kndGxmmOSyorlvC8KBKb1Q5Fu6qhQc/I+REeydsNu6BTm9b0XCyLxeXGYE/Po7jS82///ZTHXftxEMEjqsjvx+0IsYOM9oYRJpKI4gc8H7QSbmvy/4xXg9eRLb577UhrwedZCcHiNleFoE1Tsidx+22Y6gakW025LcSf7ED5DDxV8s8nn3os2z5gwqvXv4qpZ8/Ag== -------------------------------------------------------------------------------- /_css/main.scss: -------------------------------------------------------------------------------- 1 | --- 2 | # Only the main Sass file needs front matter (the dashes are enough) 3 | --- 4 | @charset "utf-8"; 5 | 6 | 7 | 8 | // Our variables 9 | $base-font-family: 'Open Sans', Helvetica, Arial, sans-serif; 10 | $base-font-size: .95em; 11 | $small-font-size: $base-font-size * 0.875; 12 | $base-line-height: 1.5; 13 | 14 | $spacing-unit: 30px; 15 | 16 | $text-color: #111; 17 | $background-color: #fdfdfd; 18 | $brand-color: #0077CC; 19 | // $gameday-sky: #109dc0; 20 | $clemson-purple: #0D325E; 21 | $clemson-orange: #f66733; 22 | 23 | 24 | $grey-color: #828282; 25 | $grey-color-light: lighten($grey-color, 40%); 26 | $grey-color-dark: darken($grey-color, 25%); 27 | 28 | 29 | // Width of the content area 30 | $content-width: 950px; 31 | 32 | $on-palm: 600px; 33 | $on-laptop: 950px; 34 | 35 | 36 | 37 | // Using media queries with like this: 38 | // @include media-query($on-palm) { 39 | // .wrapper { 40 | // padding-right: $spacing-unit / 2; 41 | // padding-left: $spacing-unit / 2; 42 | // } 43 | // } 44 | @mixin media-query($device) { 45 | @media screen and (max-width: $device) { 46 | @content; 47 | } 48 | } 49 | 50 | 51 | 52 | // Import partials from `sass_dir` (defaults to `_sass`) 53 | @import 54 | "header", 55 | "mobile-header", 56 | "base", 57 | "layout", 58 | "syntax-highlighting", 59 | "fancy-image" 60 | ; 61 | -------------------------------------------------------------------------------- /lectures/lec07_higher_order_programming/drawings/fold_right.drawio: -------------------------------------------------------------------------------- 1 | 7VpLd6IwFP41LttDSHgtR/uYxTzacTHtMkci0IOEYhTsr59gEgFjrW1VMmdmo+RyE26+e78vwTiAo1l1W+A8/k5Dkg5sK6wG8Gpg2wFy+WdtWAmD69vCEBVJKEygMYyTFyKNlrQukpDMO46M0pQledc4oVlGJqxjw0VBy67blKbdp+Y4IpphPMGpbv2dhCwWVt/2GvtXkkSxejJwA3FnhpWznMk8xiEtWyZ4PYCjglImrmbViKQ1dgoX0e/mlbubwAqSsUM6PP/w7x1wUd493Tz9zMj9y69yeYHEKEucLuSEZbBspRAo6CILST2INYBDWrCYRjTD6TdKc24E3PhEGFvJ3OEFo9wUs1kq7+qBytjndFFMyJ7oZDAMFxFhe/yg8CNhJ5cShltCZ4QVK+5QkBSzZNlNLZYVEm38GhD5hcTxHZh6GoR1YGPZzGjGv4afRpVUCXtoXT+2rq8qOe66sVKNjM/uod14bDeaTuuW6nX67LlGZc/WGDHV85mmXH/qNJZxwsg4x2sgSq6A3STheS5EaZpUdbJfR3NJCkaqvfOXd21HCopUVKAEpmz0CUpT3JImZTs6YlBDDBiGGNhCzOsZMeD/l4g29d+UCHB0hZdd72jCY95UCoTdStFKQEQqe21VwSaMjxeGa7z4BIZRyT/DBkbxyDqYR6dnRHAeQtiBc+lZDoSO6wEIkIe66Q/QpedBGwHkQ8sC0O0+QEz3ZHQJtOTr2TdqrbaV8ve28gANsuPz5ePVr3T+7QUBHbv+Pwfrjrr7Jxf0wxPomJVAfRNr2MoLbd8wKdF/O4BmQWb7W5C5PUO2a3kyQiY+QXjnQMKrEU0hvGM84V3DqhfobyfH3zucc699cO0C79i1+8rrpwf37bah1etuW6HQyj8yjDJbayRUJdsbZfQ3lL+bMpszmDfl3joPZZDauamUo/OSQs2zlWHHMFKoEymFUN/ryC7VMGIXdPYDkoPJZNYBl73rRwQ35TMYznOcdVLrPi/qA87hlGbsopTl9YW7ZLSY4bRx4FfR2lENxUMTown7EUlVx6Kqbccx6rsZhqwthql89cYw/W32xSxRQmhrpT6dKPFmc8guZL/5pwK8/gM= -------------------------------------------------------------------------------- /lectures/lec07_higher_order_programming/drawings/sum_fold.drawio: -------------------------------------------------------------------------------- 1 | 7VpLd6IwFP41LttDSHgtR/uYxTzacTHtMkci0IOEYhTsr59gEgFjrW1VMmdmo+RyE26+e78vwTiAo1l1W+A8/k5Dkg5sK6wG8Gpg2wFy+WdtWAmD69vCEBVJKEygMYyTFyKNlrQukpDMO46M0pQledc4oVlGJqxjw0VBy67blKbdp+Y4IpphPMGpbv2dhCwWVt/2GvtXkkSxejJwA3FnhpWznMk8xiEtWyZ4PYCjglImrmbViKQ1dgoX0e/mlbubwAqSsUM6PP/w7x1wUd493Tz9zMj9y69yeYHEKEucLuSEZbBspRAo6CILST2INYBDWrCYRjTD6TdKc24E3PhEGFvJ3OEFo9wUs1kq7+qBytjndFFMyJ7oZDAMFxFhe/yg8CNhJ5cShltCZ4QVK+5QkBSzZNlNLZYVEm38GhD5hcTxHZh6GoR1YGPZzGjGv4afRpVUCXtoXT+2rq8qOe66sVKNjM/uod14bDeaTuuW6nX67LlGZc/WGDHV85mmXH/qNJZxwsg4x2sgSq6A3STheS5EaZpUdbJfR3NJCkaqvfOXd21HCopUVKAEpmz0CUpT3JImZTs6YlBDDBiGGNhCzOsZMeD/l4g29d+UCHB0hZdd72jCY95UCoTdStFKQEQqe21VwSaMjxeGa7z4BIZRyT/DBkbxyDqYR6dnRHAeQtiBc+lZDoSO6wEIkIe66Q/QpedBGwHkQ8sC0O0+QEz3ZHQJtOTr2TdqrbaV8ve28gANsuPz5ePVr3T+7QUBHbv+Pwfrjrr7Jxf0wxPomJVAfRNr2MoLbd8wKdF/O4BmQWb7W5C5PUO2a3kyQiY+QXjnQMKrEU0hvGM84V3DqhfobyfH3zucc699cO0C79i1+8rrpwf37bah1etuW6HQyj8yjDJbayRUJdsbZfQ3lL+bMpszmDfl3joPZZDauamUo/OSQs2zlWHHMFKoEymFUN/ryC7VMGIXdPYDkoPJZNYBl73rRwQ35TMYznOcdVLrPi/qA87hlGbsopTl9YW7ZLSY4bRx4FfR2lENxUMTown7EUlVx6Kqbccx6rsZhqwthql89cYw/W32xSxRQmhrpT6dKPFmc8guZL/5pwK8/gM= -------------------------------------------------------------------------------- /lectures/lec12_side_effects/heap.drawio: -------------------------------------------------------------------------------- 1 | 7VpLc9owEP41HJOxJduBYyBpe2gzneaQ9NRRbIHdCssVIpj++kqW5DeBJBiHEDMD1uq12m+/1UrDAE7m6WeGkvAbDTAZACtIB/BqAMDI8cS3FKyVwBsCJZixKFAiuxDcRv+wFlpauowCvKg05JQSHiVVoU/jGPu8IkOM0VW12ZSS6qwJmuGG4NZHpCm9iwIeKukQXBTyLziahWZm2xupmjkyjfVKFiEK6KokgtcDOGGUcvU2TyeYSNsZu6h+nzbU5ooxHPNdOtwNcezd/AJ3Fn6Eq9CB/s2PMw3GIyJLveAB8IgYb7xIUCy15mttCu/vUqo6ntKYny0yoC5FA+AkaVEp3mbZrzu2xY9Y5BgO3CszqNBOjatbKcPkUwBGl3GApcKy9yqMOL5NkC9rV8K9hCzkc6KrpxEhE0ooy/rCqSs/UnPO6B9cqvGyR6tekqtH9jDQ2LlSj5hxnG40tZ0DKBwf0znmbC2a6A7QYK6dHri6vCpcyDZtwpL7eFqGtNfO8qELYMWLxvYZOMONOEubdIGzGve0cIawb5xtuwXomvFxICKcLlLGQzqjMSLXhXRcwGOJUtHmK6WJtt5vzPlah2u05LQKmZpTTvS0ZYVedMl8/MSKdKDliM0w3xbJmkgxTBCPHqt67N3sFx3Ri9i7MkooKbZEvJ1NaJGofXIapRLiBr2m2PP9NnoFF6MHy2rSy8qeDugFYD2Mug16uS3scjtjV1sYPWp2DY+BXcOu2JWP88AKYp0u35zhW+NbW3p61Hwb7cg32CffRl3xDZ4yu+q7GYR9s8vpCGf2kbWUcLZbDgWHxdntCmdwyjhD763h7G3fLd/JwRuM3Krth33bvi1HrZMgDi7ljaQo+QQtFpFfNTdOI35fev9Zer9KdfqSFdamEAvd78sF2cc6B64pF/2ykum4x4zG7CJbUxrlnk1Id4Rs59RHz/CdRlls2xCVnfoVjFqo7lW+Rq0PVEuSHbs2kDJEY6DMrfJlv8LT2rKzF3qa9XxPs3v0NPfD0w7paebi8lWelkeoc7fiOXtzm5deXRzGGaBT3agEikfqDO/u6mt3B+r18ssMvP/s/aRP4465yzV86jt7B22n8cMTrBSwQSVi23uL2NuZCXZkZq+3ZEbLEzhuQVDdxTokiygWf4lQm1fxvxJ4/R8= -------------------------------------------------------------------------------- /_sass/_mobile-header.scss: -------------------------------------------------------------------------------- 1 | @media only screen and (max-width: 600px) { 2 | 3 | .site-nav h1 { 4 | border-bottom: 3px solid transparent; 5 | cursor: pointer; 6 | display: none; /* Standard. IE8+, Saf, FF3+ */ 7 | height: 23px; 8 | left: auto; 9 | margin-top: 10px; 10 | position: static; 11 | white-space: nowrap; 12 | } 13 | 14 | .site-nav .menu { 15 | border: 3px solid transparent; 16 | border-top: 0; 17 | /* bg and border colors set in header */ 18 | -moz-box-shadow: 0px 2px 2px rgba(0,0,0,0.8); 19 | -webkit-box-shadow: 0px 2px 2px rgba(0,0,0,0.8); 20 | box-shadow: 0px 2px 2px rgba(0,0,0,0.8); 21 | /* Hide until activated */ 22 | display: block; 23 | left: -3px; 24 | min-width: 215px; 25 | /* margin-top: 36px; */ 26 | padding: 4px 0; 27 | position: relative; 28 | right: -3px; 29 | z-index: 999; 30 | } 31 | 32 | 33 | .site-nav .menu.open { 34 | display: block; 35 | } 36 | 37 | .site-nav .menu li { 38 | display: block; 39 | margin: 0; 40 | color: #522d80; 41 | } 42 | 43 | .site-nav ul.menu a { 44 | background: #fff; 45 | color: #522d80; 46 | 47 | } 48 | 49 | .site-nav a, 50 | .site-nav li.current-menu-item > a { 51 | padding: 4px 10px; 52 | } 53 | 54 | .site-nav .menu > li { 55 | height: auto; 56 | text-align: left; 57 | } 58 | 59 | .site-nav .sub-menu { 60 | border: 0; 61 | -moz-box-shadow: none; /* FF3.5+ */ 62 | -webkit-box-shadow: none; /* Saf3+, Chrome */ 63 | box-shadow: none; /* Standard. Opera 10.5, IE9 */ 64 | display: block; 65 | font-family: 'Titillium Web', Helvetica, Arial, Verdana, sans-serif; 66 | position: relative; 67 | min-width: 215px; 68 | max-width: 215px; 69 | top: auto; 70 | text-transform: uppercase; 71 | right: auto; 72 | width: auto; 73 | } 74 | 75 | .site-nav .sub-menu { 76 | padding-left: 16px; 77 | } 78 | .site-nav .sub-menu li.current-menu-item > a { 79 | border: 0; 80 | } 81 | 82 | } 83 | 84 | -------------------------------------------------------------------------------- /lectures/lec04_functions/drawings/stack1.drawio: -------------------------------------------------------------------------------- 1 | 7Vtbj5s4FP41kbYPWYHNJXnsZGa6WrVSpVmp7dPIkziEFjBjnCbZX782NrcYEtqQQLIjjWbw8Q2+7/DZ55gZwVm4/UBRvPpEFjgYAWOxHcH7EQBTy+G/hWEnDc4ESINH/YU0mYXhyf8XK6OhrGt/gZNKQ0ZIwPy4apyTKMJzVrEhSsmm2mxJguqsMfKwZniao0C3fvEXbCWtE+AW9r+w762ymU1nKmtClDVWT5Ks0IJsSib4MIIzSgiTV+F2hgOBXYaL7PfYUJvfGMURa9Ph8dPfu/nr59ePyfQ+WH17HFuWObbkKD9RsFYPrG6W7TIE8IIDooqEshXxSISCh8J6R8k6WmAxjcFLRZuPhMTcaHLjd8zYTrGL1oxw04qFgaqVc4qJGp9NmRKypnN84IFAjiz3SExCzOiO96M4QMz/WR0fKd/w8nZ518/E5zMDQ7kxhIpE5cXAMKpDMEQ9zFSvggR+UbqNwpRS8ws0Ta6MJgnHgQdyL0OTs0eTdJ+z0ZSJ1u3wNL0ITxBcmCf7OE8epyFWzTBleFu33KCXrLnRgLGOXYaBuYeBq8qbYpkxszar0hKz79NluCtA/TIqsAYVJ+DT3i1JSl8Bj/O6JlnFOEkd8T1vYE7ibVHJrzz5l/8YdjYYvzk5Xla7h3zV/zcrn+GnGKWqv+F7jKqv+2FpZQYWtwi2fL6Avw98L+JGJt6au0Ymy4wdcBadx9540p03WYfPZPm89GnCniOJdbegdg+fcntL9/qpq4O5LxDdOb0zQCkwe5cC93QpcJulwLpWKXAGJgWmvjHUtMAakBY04DcULZgOTwuA3bcWgLpNbXfbAnitWtCwNe6PJ/O4FsABaUEDfgPRguzVH5IWmNPeteC8IQK4Ui0ADVmn/njS83qaFuj+3JsWNOE3FC1onS5oci3hzCpdw/dAB6A6g2jA3kWjLsTqTjTMaxWNoeUVgB70aaJhdo1q9/gNRTRa5OwvvYHoPcUI6iIs+fYmMYpqpWBOAkKlDFDv5Q/IlzZ+ezOxmy1fvhPXwp+MVDuWKPSDnezGx0KhfFkhFE6HqI8CzZoPlqAoGSeY+st8TM4NGyP55oshA7xkeWXq9ONEer2ojQgNxQSq/gXNf3jpezLeexhg2/mse9fv6vSuE9WcwdF00iiauVkSciVaOhmYlmaL7iEtNbpGtXv8BqKlUJfOCxyj4a3Pvpauv4mh/nRtVbzfqqHTwi4rRPyB816iILvZWbHolpayfvU7xG6OxJXoHj3sAw3pudanfaeRrCcn3khuT7LTlmTYK8l6NvqN5PYkw7YkG72SrB8/vpHcnmSjJcnmqR/RnEay80by75OcHbAeJ7lfuXavhuRzknUqB/VfQVlWNTq33L3985k/KoR6hkIPSUTgW2WHYh5hqqSEAD4W95fesX03su9FeM0ZTRQVoqiCvDRmbor9RPTsR94/qYuMrUZCj0Q3h/MhluVWEDezJE0psAE1YeL5Ahs9H6Jn2G6bgpozrYtSYOmRuh6I3DQFwAY9U6CfXOubi5umAJpWzxToB7vm/2wxqPsAF16UA/3Q1tQjqZvmwKo5rOyIA14s/tdGbqGKf1iCD/8B -------------------------------------------------------------------------------- /lectures/lec04_functions/drawings/stack2.drawio: -------------------------------------------------------------------------------- 1 | 7Vtbj5s4FP41kbYPWYHNJXnsZGa6WrVSpVmp7dPIkziEFjBjnCbZX782NrcYEtqQQLIjjWbw8Q2+7/DZ55gZwVm4/UBRvPpEFjgYAWOxHcH7EQBTy+G/hWEnDc4ESINH/YU0mYXhyf8XK6OhrGt/gZNKQ0ZIwPy4apyTKMJzVrEhSsmm2mxJguqsMfKwZniao0C3fvEXbCWtE+AW9r+w762ymU1nKmtClDVWT5Ks0IJsSib4MIIzSgiTV+F2hgOBXYaL7PfYUJvfGMURa9Ph8dPfu/nr59ePyfQ+WH17HFuWObbkKD9RsFYPrG6W7TIE8IIDooqEshXxSISCh8J6R8k6WmAxjcFLRZuPhMTcaHLjd8zYTrGL1oxw04qFgaqVc4qJGp9NmRKypnN84IFAjiz3SExCzOiO96M4QMz/WR0fKd/w8nZ518/E5zMDQ7kxhIpE5cXAMKpDMEQ9zFSvggR+UbqNwpRS8ws0Ta6MJgnHgQdyL0OTs0eTdJ+z0ZSJ1u3wNL0ITxBcmCf7OE8epyFWzTBleFu33KCXrLnRgLGOXYaBuYeBq8qbYpkxszar0hKz79NluCtA/TIqsAYVJ+DT3i1JSl8Bj/O6JlnFOEkd8T1vYE7ibVHJrzz5l/8YdjYYvzk5Xla7h3zV/zcrn+GnGKWqv+F7jKqv+2FpZQYWtwi2fL6Avw98L+JGJt6au0Ymy4wdcBadx9540p03WYfPZPm89GnCniOJdbegdg+fcntL9/qpq4O5LxDdOb0zQCkwe5cC93QpcJulwLpWKXAGJgWmvjHUtMAakBY04DcULZgOTwuA3bcWgLpNbXfbAnitWtCwNe6PJ/O4FsABaUEDfgPRguzVH5IWmNPeteC8IQK4Ui0ADVmn/njS83qaFuj+3JsWNOE3FC1onS5oci3hzCpdw/dAB6A6g2jA3kWjLsTqTjTMaxWNoeUVgB70aaJhdo1q9/gNRTRa5OwvvYHoPcUI6iIs+fYmMYpqpWBOAkKlDFDv5Q/IlzZ+ezOxmy1fvhPXwp+MVDuWKPSDnezGx0KhfFkhFE6HqI8CzZoPlqAoGSeY+st8TM4NGyP55oshA7xkeWXq9ONEer2ojQgNxQSq/gXNf3jpezLeexhg2/mse9fv6vSuE9WcwdF00iiauVkSciVaOhmYlmaL7iEtNbpGtXv8BqKlUJfOCxyj4a3Pvpauv4mh/nRtVbzfqqHTwi4rRPyB816iILvZWbHolpayfvU7xG6OxJXoHj3sAw3pudanfaeRrCcn3khuT7LTlmTYK8l6NvqN5PYkw7YkG72SrB8/vpHcnmSjJcnmqR/RnEay80by75OcHbAeJ7lfuXavhuRzknUqB/VfQVlWNTq33L3985k/KoR6hkIPSUTgW2WHYh5hqqSEAD4W95fesX03su9FeM0ZTRQVoqiCvDRmbor9RPTsR94/qYuMrUZCj0Q3h/MhluVWEDezJE0psAE1YeL5Ahs9H6Jn2G6bgpozrYtSYOmRuh6I3DQFwAY9U6CfXOubi5umAJpWzxToB7vm/2wxqPsAF16UA/3Q1tQjqZvmwKo5rOyIA14s/tdGbqGKf1iCD/8B -------------------------------------------------------------------------------- /_includes/head.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | {% if page.title %}{{ site.title }}: {{ page.title }}{% else %}{{ site.title }}: {{ site.subtitle }}{% endif %} 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | {% if site.google_author %}{% endif %} 17 | {% if site.google_site_verification %}{% endif %} 18 | {% if site.bing_webmastertools_id %}{% endif %} 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /_includes/footer.html: -------------------------------------------------------------------------------- 1 | 77 | -------------------------------------------------------------------------------- /_docker/dockerfile: -------------------------------------------------------------------------------- 1 | FROM ocaml/opam:ubuntu-ocaml-4.14 2 | RUN sudo apt update --fix-missing 3 | RUN sudo apt install -y libgmp-dev pkg-config libzmq3-dev zlib1g-dev 4 | 5 | RUN curl -LsSf https://astral.sh/uv/install.sh | sh 6 | ENV PATH="/home/opam/.local/bin:/home/opam/.local/share/uv/tools/jupyterlab/bin:$PATH" 7 | 8 | RUN uv tool install jupyterlab 9 | RUN opam update 10 | RUN opam install jupyter merlin 11 | 12 | # Register the OCaml kernel with Jupyter 13 | RUN grep topfind ~/.ocamlinit || echo '#use "topfind";;' >> ~/.ocamlinit # For using '#require' directive 14 | RUN grep Topfind.log ~/.ocamlinit || echo 'Topfind.log:=ignore;;' >> ~/.ocamlinit # Suppress logging of topfind (recommended but not necessary) 15 | # Enable Merlin in OCaml REPL 16 | RUN grep merlin ~/.ocamlinit || echo '#require "merlin";;' >> ~/.ocamlinit 17 | RUN eval $(opam env) && ocaml-jupyter-opam-genspec 18 | # Register the OCaml kernel with Jupyter 19 | RUN eval $(opam env) && jupyter kernelspec install --name ocaml-jupyter "$(opam var share)/jupyter" --user 20 | 21 | # Install Jupyter extensions 22 | RUN uv pip install RISE --python ~/.local/share/uv/tools/jupyterlab/bin/python # For presentations 23 | RUN uv pip install jupyterlab-rise --python ~/.local/share/uv/tools/jupyterlab/bin/python # JupyterLab extension for RISE 24 | RUN uv pip install jupyterlab-mathjax3 --python ~/.local/share/uv/tools/jupyterlab/bin/python # Better LaTeX support 25 | #RUN uv pip install jupyter-ai --python ~/.local/share/uv/tools/jupyterlab/bin/python # AI assistance in JupyterLab 26 | #RUN uv pip install langchain-openai --python ~/.local/share/uv/tools/jupyterlab/bin/python # OpenAI provider for Jupyter AI 27 | #RUN uv pip install langchain-anthropic --python ~/.local/share/uv/tools/jupyterlab/bin/python # Anthropic provider for Jupyter AI 28 | 29 | # Install SWI-Prolog 30 | RUN sudo apt install -y swi-prolog 31 | RUN uv pip install git+https://github.com/kayceesrk/jupyter-swi-prolog.git --python ~/.local/share/uv/tools/jupyterlab/bin/python 32 | RUN mkdir -p ~/.local/share/jupyter/kernels/jswipl 33 | RUN curl -o ~/.local/share/jupyter/kernels/jswipl/kernel.json https://raw.githubusercontent.com/targodan/jupyter-swi-prolog/master/kernel.json 34 | 35 | WORKDIR /cs3100_iitm 36 | 37 | # Default command to start JupyterLab 38 | CMD ["jupyter", "lab", "--ip=0.0.0.0", "--port=8888", "--no-browser", "--allow-root"] 39 | -------------------------------------------------------------------------------- /resources.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: page 3 | title: Resources 4 | permalink: /resources/ 5 | --- 6 | 7 | # Software 8 | 9 | The course comes with a handy [docker 10 | image](https://hub.docker.com/r/kayceesrk/cs3100_iitm) which contains the 11 | necessary software to run OCaml, SWI-Prolog and the Jupyter notebooks, primarily 12 | through which the course is taught. The instructions for running the Jupyter 13 | notebooks is [here](https://github.com/kayceesrk/cs3100_m25). 14 | 15 | ## Docker 16 | 17 | Docker is a free software and is supported 18 | on all major platforms. The installation instructions for Docker is available 19 | [here](https://docs.docker.com/install/#supported-platforms). 20 | 21 | ## OCaml 22 | 23 | You don't need a local installation of OCaml on your machine for the course. The 24 | docker image is enough. If you want to, check out 25 | [ocaml.org](https://ocaml.org/). 26 | 27 | ## SWI-Prolog 28 | 29 | You don't need a local installation of SWI-Prolog on your machine for the 30 | course. The docker image is enough. If you want to, SWI-Prolog installation 31 | instructions are [here](https://www.swi-prolog.org/Download.html). 32 | 33 | # Learning 34 | 35 | ## OCaml 36 | 37 | ### Recommended 38 | 39 | * **Functional Programming in OCaml**, Cornell CS3110 textbook. Freely available 40 | [here](http://www.cs.cornell.edu/courses/cs3110/2019sp/textbook/). 41 | * **Real World OCaml**, by Yaron Minsky, Anil Madhavapeddy and Jason Hickey. The 42 | book is freely available at 43 | [dev.realworldocaml.org](https://dev.realworldocaml.org/). 44 | 45 | ### References 46 | * [**OCaml Manual**](http://caml.inria.fr/pub/docs/manual-ocaml/index.html) 47 | 48 | ### Practice 49 | 50 | * [99 Problems](https://ocaml.org/learn/tutorials/99problems.html) 51 | 52 | ## Lambda Calculus 53 | 54 | ### Recommended 55 | 56 | * **Types and Programming Languages** (TAPL), by Benjamin Pierce. 57 | * **Peter Selinger's lecture notes on lambda calculus** available 58 | [here](https://arxiv.org/abs/0804.3434). 59 | 60 | ## Prolog 61 | 62 | ### Recommended 63 | 64 | * **Programming Languages, Concepts and Constructs, 2nd edition**, by Ravi 65 | Sethi. Chapter 11. 66 | 67 | ### References 68 | 69 | * **The Art of Prolog, 2nd edition, Advanced Programming Techniques**, by Leon 70 | Sterling and Ehud Y. Shapiro. Available for free 71 | [here](https://mitpress.mit.edu/books/art-prolog-second-edition). 72 | * [P-99: Ninety-Nine Prolog Problems](https://www.ic.unicamp.br/~meidanis/courses/mc336/2009s2/prolog/problemas/) 73 | -------------------------------------------------------------------------------- /_includes/header.html: -------------------------------------------------------------------------------- 1 | 51 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # CS3100: Paradigms of Programming (IITM Monsoon 2025) 2 | 3 | This is the Github repo for the course CS3100 Paradigms of Programming taught at 4 | IITM in the Monsoon semester 2025. The course website is here: 5 | https://kcsrk.info/cs3100_m25/. 6 | 7 | The course teaches OCaml and Prolog. 8 | 9 | The first part of the course covers OCaml. The course covers a significant chunk 10 | of the OCaml language. You should be able to self-study the course to get a good 11 | understanding of the language. That said, the course deliberately does not cover 12 | the build system (dune), package manager (opam), command-line tools for the 13 | compiler (ocamlc, ocamlopt), editor integration (merlin, ocaml-lsp, 14 | ocamlformat), etc. If you are keen to learn these, please refer to the excellent 15 | [ocaml.org](https://ocaml.org/) website. In addition, the course does not cover 16 | the use of OCaml libraries. Hence, the course is not meant to make you a 17 | "productive" OCaml programmer building real-world applications. For this, I 18 | recommend [Real World OCaml](https://dev.realworldocaml.org/). 19 | 20 | The second part of the course covers Prolog. The course gives a good 21 | introduction to Prolog, but does not go beyond the basics. 22 | 23 | ## Running the JupyterLab environment 24 | 25 | Install [docker](https://docs.docker.com/install/#supported-platforms) for your 26 | platform. The Docker image includes JupyterLab with OCaml and SWI-Prolog kernels, 27 | plus RISE extension for presentations. Then run 28 | 29 | ```bash 30 | git clone https://github.com/kayceesrk/cs3100_m25 31 | cd cs3100_m25 32 | docker run -it -p 8888:8888 -v "$(pwd)":/cs3100_iitm kayceesrk/cs3100_iitm:m25 33 | ``` 34 | 35 | Copy and paste the displayed URL that starts with `http://127.0.0.1:8888` into 36 | your browser to access JupyterLab. If you save the changes to the notebooks, 37 | they are saved locally. The environment includes presentation mode (RISE) - 38 | look for the presentation button in the toolbar. As you go through the course, 39 | you will have to do `git pull` in the `cs3100_m25` directory to get the latest 40 | updates from upstream. 41 | 42 | ## Tips 43 | 44 | For navigating the notebooks in presentation mode, only stick to 45 | 46 | * `space` -- move forward 47 | * `shift+space` -- move backward 48 | * `cmd+enter` -- execute cell 49 | 50 | Anything else, such as the arrow keys, `shift+enter`, etc, will lead to [unintuitive behaviour](https://rise.readthedocs.io/en/latest/usage.html#navigation). 51 | 52 | Limited editor support is available for OCaml. 53 | 54 | * `tab` -- code completion 55 | * `shift+tab` -- inspection 56 | 57 | See https://ocaml.org/p/jupyter/latest#code-completion. 58 | -------------------------------------------------------------------------------- /index.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | --- 4 | 5 |
6 | 7 |

{{ site.subtitle }}

8 | 9 |
10 | 11 | {% include image.html url="/cs3100_m25/_images/paradigms.png" 12 | href="https://www.info.ucl.ac.be/~pvr/VanRoyChapter.pdf" 13 | caption="Don't worry. We will only cover a small subset of this." width=800 align="center" %} 14 | 15 | The aim of the course is to teach you about the different paradigms of 16 | programming, their underlying concepts, and the relationships between them. We 17 | will mostly look at functional and logic programming, touching upon imperative 18 | programming concepts as we go through the course. We will study functional 19 | paradigm through [OCaml](https://ocaml.org/) and logic paradigm through Prolog 20 | (specifically [SWI-Prolog](https://www.swi-prolog.org/)). The official course 21 | description is [here](http://www.cse.iitm.ac.in/course_details.php?arg=MTk=). 22 | 23 | The course will be primarily taught through interactive [Jupyter 24 | Notebooks](https://jupyter.org/). The instructions for setting up the notebooks 25 | is found [here](https://github.com/kayceesrk/cs3100_m25). 26 | 27 | ## Essential Details 28 | 29 | * **Instructor:** [KC Sivaramakrishnan](http://kcsrk.info), who goes by "KC". 30 | * **Where:** SSB 134 31 | * **When:** E Slot: Tue 1100 -- 1150, Wed 1000 -- 1050, Thu 0800 -- 0850, Fri 1700 -- 1750 32 | * **Slack**: [http://cs3100m25iitm.slack.com/](http://cs3100m25iitm.slack.com/) Join using `@smail.iitm.ac.in`. 33 | * **Moodle**: [https://courses.iitm.ac.in/course/view.php?id=9781](https://courses.iitm.ac.in/course/view.php?id=9781) 34 | * **TAs:** 35 | 36 | | Name | Email (@smail.iitm.ac.in) | 37 | |------|-------| 38 | | Sai Venkata Krishnan V | cs20d408 | 39 | | Durwasa Chakraborty | cs24d011 | 40 | | Vishakh Desai | cs25s018 | 41 | | Sagar Biswas | cs24m039 | 42 | | Pradeep Peter Murmu | cs24m033 | 43 | | Md Isfarul Haque | cs22b010 | 44 | | Pranav | cs22b015 | 45 | | Kishore Kumar E | cs22b041 | 46 | 47 | 48 |
49 | Liaise with the TAs over email about where to meet. 50 | 51 | ## Grading 52 | 53 | | Item | Weightage (%) | 54 | |---------------|---------------| 55 | | Quiz 1 | 15% | 56 | | Quiz 2 | 15% | 57 | | Pop quiz (best 4 out of 6) | 15% | 58 | | Programming Assignments | 20% | 59 | | EndSem | 35% | 60 | 61 |
62 | 63 | We will use absolute grading: S 90, A 80, B 70, C 60, D 50, E 35. 64 | 65 |
66 | 67 | ## Acknowledgements 68 | 69 | The course borrows some of the materials from 70 | 71 | * [Cornell: cs3110](http://www.cs.cornell.edu/courses/cs3110/2019sp/) 72 | * [University of Cambridge Computer Laboratory: Prolog](https://www.cl.cam.ac.uk/teaching/1819/Prolog/) 73 | * [University of Cambridge Computer Laboratory: Advanced Functional Programming](https://www.cl.cam.ac.uk/teaching/1718/L28/) 74 | * [University of Washington: CS341](https://courses.cs.washington.edu/courses/cse341/20sp/) 75 | -------------------------------------------------------------------------------- /assignments.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: page 3 | title: Assignments 4 | permalink: /assignments/ 5 | --- 6 | 7 | All assignments should be submitted through the [course 8 | moodle](https://courses.iitm.ac.in/course/view.php?id=9781). 9 | 10 | | Assignment | Due Date | 11 | |:------------:|----------| 12 | | 0 | 13/08 | 13 | | 1 | 27/08 | 14 | | 2 | 14/09 | 15 | | 3 | 20/10 | 16 | | 4 | 11/11 | 17 | | 5 | 11/11 | 18 | 19 |
20 | 21 | ## Assignment late penalties 22 | 23 | We are flexible about submitting assignments late. Unless otherwise specified, 24 | assignments may be turned in late with the following penalties applied to the 25 | score received: 26 | 27 | * 1 day late: −25% 28 | * 2 days late: −50% 29 | * > 2 days late: we will not grade it. 30 | 31 | Homework and programming assignments will be accepted up to 2 days late, but at 32 | a penalty. The penalty is 25% for one day late, and 50% for two days late. 33 | 34 | Late penalties may be avoided or reduced by obtaining an extension on the 35 | assignment. However, any extensions must be approved by the instructor at least 36 | two days before the due date—last-minute extensions will not be granted except 37 | in exceptional circumstances. Extension requests should be made via Slack; 38 | copying all group members on the request. They should include a description of 39 | why an extension is being requested. 40 | 41 | ## Response times 42 | 43 | Feel free to ask questions about assignments in the Slack channel. Please use 44 | `#townhall` channel if the question is not expected to be private to avoid 45 | having to answer the same questions repeatedly. We will aim to answer questions 46 | within 24 hours. We shall do our best to answer questions asap, but this is best 47 | effort. Even if these questions appear on the day of the deadline, responses may 48 | take up to 24 hours. Start early; avoid asking question and expecting answers in 49 | the last few hours of the deadline. 50 | 51 | ## Academic Integrity 52 | 53 | You’re in college; you’re expected and encouraged to discuss your work with 54 | others. That said, **everything you write for this course -- code, written 55 | assignments, pop quizzes, and everything else—must be your own original work.** 56 | 57 | You may use tools like compilers, linters, or AI assistants (like ChatGPT or 58 | GitHub Copilot). However: 59 | 60 | - **You must cite any AI tools or external sources you use**, and clearly 61 | indicate what parts of your work were influenced by them. 62 | - **You are responsible for understanding and being able to explain everything 63 | you submit**. If you don’t understand what it's doing, don’t turn it in. 64 | - Using AI tools without acknowledgment, or submitting work you can’t explain, 65 | may be treated as plagiarism. 66 | - If in doubt, ask. It’s always better to clarify than to guess. 67 | 68 | Plagiarism of any kind will be reported to the institute and may result in 69 | disciplinary action. 70 | -------------------------------------------------------------------------------- /lectures/lec03_expressions/images/val-expr.svg: -------------------------------------------------------------------------------- 1 | 2 |






Expressions
[Not supported by viewer]
Values
[Not supported by viewer]
-------------------------------------------------------------------------------- /_sass/_syntax-highlighting.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * Syntax highlighting styles 3 | */ 4 | .highlight code, .highlight pre, .highlighter-rouge code, .highlighter-rouge pre { 5 | color:#fdce93; 6 | background-color:#3f3f3f; 7 | } 8 | 9 | .highlight .hll { 10 | background-color:#222; 11 | } 12 | 13 | .highlight .err { 14 | color:#e37170; 15 | background-color:#3d3535; 16 | } 17 | 18 | .highlight .k { 19 | color:#f0dfaf; 20 | } 21 | 22 | .highlight .p { 23 | color:#41706f; 24 | } 25 | 26 | .highlight .cs { 27 | color:#cd0000; 28 | font-weight:700; 29 | } 30 | 31 | .highlight .gd { 32 | color:#cd0000; 33 | } 34 | 35 | .highlight .ge { 36 | color:#ccc; 37 | font-style:italic; 38 | } 39 | 40 | .highlight .gr { 41 | color:red; 42 | } 43 | 44 | .highlight .go { 45 | color:gray; 46 | } 47 | 48 | .highlight .gs { 49 | color:#ccc; 50 | font-weight:700; 51 | } 52 | 53 | .highlight .gu { 54 | color:purple; 55 | font-weight:700; 56 | } 57 | 58 | .highlight .gt { 59 | color:#0040D0; 60 | } 61 | 62 | .highlight .kc { 63 | color:#dca3a3; 64 | } 65 | 66 | .highlight .kd { 67 | color:#ffff86; 68 | } 69 | 70 | .highlight .kn { 71 | color:#dfaf8f; 72 | font-weight:700; 73 | } 74 | 75 | .highlight .kp { 76 | color:#cdcf99; 77 | } 78 | 79 | .highlight .kr { 80 | color:#cdcd00; 81 | } 82 | 83 | .highlight .ni { 84 | color:#c28182; 85 | } 86 | 87 | .highlight .ne { 88 | color:#c3bf9f; 89 | font-weight:700; 90 | } 91 | 92 | .highlight .nn { 93 | color:#8fbede; 94 | } 95 | 96 | .highlight .vi { 97 | color:#ffffc7; 98 | } 99 | 100 | .highlight .c,.preview-zenburn .highlight .g,.preview-zenburn .highlight .cm,.preview-zenburn .highlight .cp,.preview-zenburn .highlight .c1 { 101 | color:#7f9f7f; 102 | } 103 | 104 | .highlight .l,.preview-zenburn .highlight .x,.preview-zenburn .highlight .no,.preview-zenburn .highlight .nd,.preview-zenburn .highlight .nl,.preview-zenburn .highlight .nx,.preview-zenburn .highlight .py,.preview-zenburn .highlight .w { 105 | color:#ccc; 106 | } 107 | 108 | .highlight .n,.preview-zenburn .highlight .nv,.preview-zenburn .highlight .vg { 109 | color:#dcdccc; 110 | } 111 | 112 | .highlight .o,.preview-zenburn .highlight .ow { 113 | color:#f0efd0; 114 | } 115 | 116 | .highlight .gh,.preview-zenburn .highlight .gp { 117 | color:#dcdccc; 118 | font-weight:700; 119 | } 120 | 121 | .highlight .gi,.preview-zenburn .highlight .kt { 122 | color:#00cd00; 123 | } 124 | 125 | .highlight .ld,.preview-zenburn .highlight .s,.preview-zenburn .highlight .sb,.preview-zenburn .highlight .sc,.preview-zenburn .highlight .sd,.preview-zenburn .highlight .s2,.preview-zenburn .highlight .se,.preview-zenburn .highlight .sh,.preview-zenburn .highlight .si,.preview-zenburn .highlight .sx,.preview-zenburn .highlight .sr,.preview-zenburn .highlight .s1,.preview-zenburn .highlight .ss { 126 | color:#cc9393; 127 | } 128 | 129 | .highlight .m,.preview-zenburn .highlight .mf,.preview-zenburn .highlight .mh,.preview-zenburn .highlight .mi,.preview-zenburn .highlight .mo,.preview-zenburn .highlight .il { 130 | color:#8cd0d3; 131 | } 132 | 133 | .highlight .na,.preview-zenburn .highlight .nt { 134 | color:#9ac39f; 135 | } 136 | 137 | .highlight .nb,.preview-zenburn .highlight .nc,.preview-zenburn .highlight .nf,.preview-zenburn .highlight .bp,.preview-zenburn .highlight .vc { 138 | color:#efef8f; 139 | } 140 | -------------------------------------------------------------------------------- /assignments/assignment0/assignment0.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": {}, 6 | "source": [ 7 | "Before you turn this problem in, make sure everything runs as expected. First, **restart the kernel** (in the menubar, select Kernel$\\rightarrow$Restart) and then **run all cells** (in the menubar, select Cell$\\rightarrow$Run All).\n", 8 | "\n", 9 | "Make sure you fill in any place that says `YOUR CODE HERE` or \"YOUR ANSWER HERE\", as well as your name below:" 10 | ] 11 | }, 12 | { 13 | "cell_type": "code", 14 | "execution_count": null, 15 | "metadata": {}, 16 | "outputs": [], 17 | "source": [ 18 | "let name = \"\"\n", 19 | "let rollno = \"\"" 20 | ] 21 | }, 22 | { 23 | "cell_type": "markdown", 24 | "metadata": {}, 25 | "source": [ 26 | "## Important notes about grading:\n", 27 | "\n", 28 | "1. **Compiler errors:** All code you submit must compile. Programs that do not compile will probably receive an automatic zero. If you are having trouble getting your assignment to compile, please visit consulting hours. If you run out of time, it is better to comment out the parts that do not compile, than hand in a more complete file that does not compile.\n", 29 | "2. **Late assignments:** Please carefully review the course website's policy on late assignments, as all assignments handed in after the deadline will be considered late. Verify on moodle that you have submitted the correct version, before the deadline. Submitting the incorrect version before the deadline and realizing that you have done so after the deadline will be counted as a late submission." 30 | ] 31 | }, 32 | { 33 | "cell_type": "markdown", 34 | "metadata": { 35 | "deletable": false, 36 | "editable": false, 37 | "nbgrader": { 38 | "cell_type": "markdown", 39 | "checksum": "b815fcf202334e09caf8f6ea6ae61c45", 40 | "grade": false, 41 | "grade_id": "cell-8e65b68a4a6328c5", 42 | "locked": true, 43 | "schema_version": 3, 44 | "solution": false 45 | } 46 | }, 47 | "source": [ 48 | "## Problem 1\n", 49 | "\n", 50 | "Implement predecessor function\n", 51 | "\n", 52 | "```ocaml\n", 53 | "pred : int -> int\n", 54 | "```\n", 55 | "\n", 56 | "which returns the predecessor of the given integer." 57 | ] 58 | }, 59 | { 60 | "cell_type": "code", 61 | "execution_count": null, 62 | "metadata": { 63 | "deletable": false, 64 | "nbgrader": { 65 | "cell_type": "code", 66 | "checksum": "0a1c22fe0c0e1485086337a90e3bdf77", 67 | "grade": false, 68 | "grade_id": "cell-304066634b90fa89", 69 | "locked": false, 70 | "schema_version": 3, 71 | "solution": true 72 | } 73 | }, 74 | "outputs": [], 75 | "source": [ 76 | "let pred x = \n", 77 | " (* YOUR CODE HERE *)\n", 78 | " raise (Failure \"Not implemented\")" 79 | ] 80 | }, 81 | { 82 | "cell_type": "code", 83 | "execution_count": null, 84 | "metadata": { 85 | "deletable": false, 86 | "editable": false, 87 | "nbgrader": { 88 | "cell_type": "code", 89 | "checksum": "fe438fdb9da6e38740d85e0eafd22922", 90 | "grade": true, 91 | "grade_id": "cell-785fb22b90a8c878", 92 | "locked": true, 93 | "points": 10, 94 | "schema_version": 3, 95 | "solution": false 96 | } 97 | }, 98 | "outputs": [], 99 | "source": [ 100 | "assert (pred 1 = 0)" 101 | ] 102 | } 103 | ], 104 | "metadata": { 105 | "kernelspec": { 106 | "display_name": "OCaml 4.14.2", 107 | "language": "OCaml", 108 | "name": "ocaml-jupyter" 109 | }, 110 | "language_info": { 111 | "codemirror_mode": "text/x-ocaml", 112 | "file_extension": ".ml", 113 | "mimetype": "text/x-ocaml", 114 | "name": "OCaml", 115 | "nbconverter_exporter": null, 116 | "pygments_lexer": "OCaml", 117 | "version": "4.14.2" 118 | } 119 | }, 120 | "nbformat": 4, 121 | "nbformat_minor": 4 122 | } 123 | -------------------------------------------------------------------------------- /schedule.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: page 3 | title: Schedule 4 | permalink: /schedule/ 5 | --- 6 | 7 | | Lectures | Topic | Dates | Comments | 8 | |----------|-------|-------|----------| 9 | | 1 | Why PL? | 29/07 | | 10 | | 2 | Why FP? | 30/07 | | 11 | | 3 | Expressions | 30/07, 01/08 06/08 | [WAT](https://www.destroyallsoftware.com/talks/wat), [CS3110 Expressions](https://cs3110.github.io/textbook/chapters/basics/expressions.html) | 12 | | 4 | Functions | 06/08, 07/08, 08/08, 12/08 | [CS3110 Functions](https://cs3110.github.io/textbook/chapters/basics/functions.html) | 13 | | 5 | Datatypes | 12/08, 13/08, 14/08 | [CS3110 Datatypes and pattern matching](https://cs3110.github.io/textbook/chapters/data/intro.html#data-and-type) | 14 | | 6 | Pattern Matching | 14/08, 19/08, 20/08 | [CS3110 Datatypes and pattern matching](https://cs3110.github.io/textbook/chapters/data/intro.html#data-and-type) | 15 | | 7 | Higher-order programming | 20/08, 21/08 | [CS3110 Higher-order programming](https://cs3110.github.io/textbook/chapters/hop/intro.html#higher-order-programming) | 16 | | 8 | Lambda Calculus: Syntax | 21/08, 22/08, 26/08 | [TAPL](https://www.cis.upenn.edu/~bcpierce/tapl/) Chap. 5, Peter Selinger's [lecture notes on lambda calculus](https://arxiv.org/abs/0804.3434) Chap. 2 | 17 | | 9 | Lambda Calculus: Semantics | 29/08, 02/09, 04/09 | [TAPL](https://www.cis.upenn.edu/~bcpierce/tapl/) Chap. 5, Peter Selinger's [lecture notes on lambda calculus](https://arxiv.org/abs/0804.3434) Chap. 2 | 18 | | 10| Lambda Calculus: Encodings | 16/09, 17/09, 18/09 | TAPL Chap. 5, Peter Selinger's [lecture notes on lambda calculus](https://arxiv.org/abs/0804.3434) Chap. 3 | 19 | | 11| Lambda Calculus: STLC | 19/09, 23/09, 24/09, 25/09 | TAPL Chap. 9, Peter Selinger's [lecture notes on lambda calculus](https://arxiv.org/abs/0804.3434) Chap. 6 | 20 | | 12| (Side) Effects | 30/09, 01/10, 03/10 | [CS3110 Mutability](https://cs3110.github.io/textbook/chapters/mut/intro.html) | 21 | | 13| Modular Programming | 03/10, 07/10, 08/10, 10/10 | [CS3110 Modular Programming](https://cs3110.github.io/textbook/chapters/modules/intro.html) | 22 | | 14| Prolog Basics | 10/10, 14/10(TA) | [Chapter 11 in PLCC](https://www.amazon.in/Programming-Languages-Concepts-Constructs-2e/dp/8177584227) | 23 | | 15| Logical Foundations | 14/10(TA), 15/10(TA) | [Chapter 1, 2, 3.1 in Logic, Programming and Prolog 2ed](https://www.ida.liu.se/~ulfni53/lpp/) | 24 | | 16| Solving a Logic Puzzle | 15/10(TA) | | 25 | | 17| Programming with Lists | 16/10(TA), 17/10(TA) | [Chapter 11 in PLCC](https://www.amazon.in/Programming-Languages-Concepts-Constructs-2e/dp/8177584227), [Chapter 3 in AoP](https://mitpress.mit.edu/books/art-prolog-second-edition) | 26 | | 18| Control in Prolog | 17/10(TA), 21/10, 22/10 | [Chapter 11 in PLCC](https://www.amazon.in/Programming-Languages-Concepts-Constructs-2e/dp/8177584227), [Chapter 4 in AoP](https://mitpress.mit.edu/books/art-prolog-second-edition) | 27 | | 19| Mutable(?) data structures | 22/10, 23/10, 24/10 | [Chapter 11 in PLCC](https://www.amazon.in/Programming-Languages-Concepts-Constructs-2e/dp/8177584227), [Chapter 15 in AoP](https://mitpress.mit.edu/books/art-prolog-second-edition) | 28 | | 20| Generate and Test | 24/10, 28/10 | [Chapter 11 in PLCC](https://www.amazon.in/Programming-Languages-Concepts-Constructs-2e/dp/8177584227), [Chapter 14.1 in AoP](https://mitpress.mit.edu/books/art-prolog-second-edition) | 29 | | 21| Cuts and Negation | 28/10, 29/10 | [Chapter 11 in PLCC](https://www.amazon.in/Programming-Languages-Concepts-Constructs-2e/dp/8177584227), [Chapter 11 in AoP](https://mitpress.mit.edu/books/art-prolog-second-edition) | 30 | | 22| Countdown, Type Inference and Program Synthesis | 30/10, 31/10, 04/11 | | 31 | 32 |
33 | 34 | Total lecture hours till (31/10) is (43). 35 | 36 | The lectures are available as interactive notebooks. They are best accessed 37 | using docker container whose instructions are 38 | [here](https://github.com/kayceesrk/cs3100_m25). 39 | 40 | ## Pop Quizzes 41 | 42 | | Quiz | Date | 43 | |------|-------| 44 | | 1 | 08/08 | 45 | | 2 | 21/08 | 46 | | 3 | 19/09 | 47 | | 4 | 07/10 | 48 | | 5 | 28/10 | 49 | | 6 | 04/11 | 50 | 51 | -------------------------------------------------------------------------------- /lectures/lec03_expressions/images/val-expr-defn.svg: -------------------------------------------------------------------------------- 1 | 2 |






Expressions
[Not supported by viewer]
Values
[Not supported by viewer]
Definitions
[Not supported by viewer]
-------------------------------------------------------------------------------- /_sass/_base.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * Reset some basic elements 3 | */ 4 | body, h1, h2, h3, h4, h5, h6, 5 | p, blockquote, pre, hr, 6 | dl, dd, ol, ul, figure { 7 | margin: 0; 8 | padding: 0; 9 | } 10 | 11 | 12 | 13 | /** 14 | * Basic styling 15 | */ 16 | body { 17 | font-family: $base-font-family; 18 | font-size: $base-font-size; 19 | line-height: $base-line-height; 20 | font-weight: 300; 21 | color: $text-color; 22 | background-color: $background-color; 23 | -webkit-text-size-adjust: 100%; 24 | } 25 | 26 | 27 | 28 | 29 | /** 30 | * Set `margin-bottom` to maintain vertical rhythm 31 | */ 32 | h1, h2, h3, h4, h5, h6, 33 | p, blockquote, pre, 34 | ul, ol, dl, figure, 35 | %vertical-rhythm { 36 | margin-bottom: $spacing-unit / 2; 37 | } 38 | 39 | 40 | 41 | /** 42 | * Images 43 | */ 44 | img { 45 | max-width: 100%; 46 | vertical-align: middle; 47 | } 48 | 49 | 50 | 51 | /** 52 | * Figures 53 | */ 54 | figure > img { 55 | display: block; 56 | } 57 | 58 | figcaption { 59 | font-size: $small-font-size; 60 | } 61 | 62 | 63 | 64 | /** 65 | * Lists 66 | */ 67 | ul, ol { 68 | margin-left: $spacing-unit; 69 | } 70 | 71 | li { 72 | > ul, 73 | > ol { 74 | margin-bottom: 0; 75 | } 76 | } 77 | 78 | 79 | 80 | /** 81 | * Headings 82 | */ 83 | h1, h2, h3, h4, h5, h6 { 84 | font-weight: 200; 85 | } 86 | 87 | 88 | 89 | /** 90 | * Links 91 | */ 92 | a { 93 | color: $brand-color; 94 | text-decoration: none; 95 | 96 | &:visited { 97 | /* color: darken($brand-color, 15%); */ 98 | } 99 | 100 | &:hover { 101 | color: $text-color; 102 | text-decoration: underline; 103 | } 104 | } 105 | 106 | /* .post-content a, .home a { 107 | font-weight: 500; 108 | } */ 109 | 110 | /** 111 | * Blockquotes 112 | */ 113 | blockquote { 114 | color: $grey-color; 115 | border-left: 4px solid $grey-color-light; 116 | padding-left: $spacing-unit / 2; 117 | font-size: 18px; 118 | letter-spacing: -1px; 119 | font-style: italic; 120 | 121 | > :last-child { 122 | margin-bottom: 0; 123 | } 124 | } 125 | 126 | 127 | 128 | /** 129 | * Code formatting 130 | */ 131 | pre, 132 | code { 133 | font-size: 14px; 134 | border: 1px solid $grey-color-light; 135 | border-radius: 3px; 136 | background-color: #eef; 137 | } 138 | 139 | code { 140 | padding: 1px 5px; 141 | } 142 | 143 | pre { 144 | padding: 8px 12px; 145 | overflow-x: scroll; 146 | 147 | > code { 148 | border: 0; 149 | padding-right: 0; 150 | padding-left: 0; 151 | } 152 | } 153 | 154 | 155 | 156 | /** 157 | * Wrapper 158 | */ 159 | .wrapper { 160 | max-width: -webkit-calc(#{$content-width} - (#{$spacing-unit} * 2)); 161 | max-width: calc(#{$content-width} - (#{$spacing-unit} * 2)); 162 | margin-right: auto; 163 | margin-left: auto; 164 | padding-right: $spacing-unit; 165 | padding-left: $spacing-unit; 166 | @extend %clearfix; 167 | 168 | @include media-query($on-laptop) { 169 | max-width: -webkit-calc(#{$content-width} - (#{$spacing-unit})); 170 | max-width: calc(#{$content-width} - (#{$spacing-unit})); 171 | padding-right: $spacing-unit / 2; 172 | padding-left: $spacing-unit / 2; 173 | } 174 | } 175 | 176 | 177 | 178 | /** 179 | * Clearfix 180 | */ 181 | %clearfix { 182 | 183 | &:after { 184 | content: ""; 185 | display: table; 186 | clear: both; 187 | } 188 | } 189 | 190 | 191 | 192 | /** 193 | * Icons 194 | */ 195 | .icon { 196 | 197 | > svg { 198 | display: inline-block; 199 | width: 16px; 200 | height: 16px; 201 | vertical-align: middle; 202 | 203 | path { 204 | fill: $grey-color; 205 | } 206 | } 207 | } 208 | 209 | 210 | 211 | a.tosu { 212 | color: #b00000; 213 | background: #f5f5f5; 214 | text-decoration: none; 215 | padding: 2px; 216 | font-weight: 600; 217 | font-family: 'Capita', Georgia, serif; 218 | } 219 | 220 | /** 221 | * Tables 222 | */ 223 | 224 | table{ 225 | border-collapse: collapse; 226 | border-spacing: 0; 227 | border:2px solid #000000; 228 | } 229 | 230 | th{ 231 | border:2px solid #000000; 232 | padding: 10px; 233 | } 234 | 235 | td{ 236 | border:1px solid #000000; 237 | padding: 10px; 238 | } 239 | 240 | tr:nth-child(even){ 241 | background: #dae5f4; 242 | } 243 | -------------------------------------------------------------------------------- /_sass/_header.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * Site header 3 | */ 4 | .site-header { 5 | border-top: 0px solid $grey-color-dark; 6 | border-bottom: 4px solid $clemson-orange; 7 | min-height: 56px; 8 | background: $clemson-purple; 9 | // Positioning context for the mobile navigation icon 10 | position: relative; 11 | 12 | } 13 | 14 | .site-title { 15 | font-size: 26px; 16 | /* margin-top: 15px; 17 | line-height: 40px; */ 18 | letter-spacing: -1px; 19 | margin-bottom: 0; 20 | float: left; 21 | font-weight: 500; 22 | font-family: 'Titillium Web', sans-serif; 23 | color: #ffffff; 24 | &, 25 | &:visited { 26 | color: #ffffff; 27 | } 28 | &, 29 | &:hover { 30 | text-decoration: none; 31 | } 32 | } 33 | 34 | .site-header .wrapper { 35 | padding-top: 20px; 36 | position: relative; 37 | } 38 | 39 | .site-nav ul li a { 40 | color: #fff; 41 | } 42 | 43 | .site-nav ul { 44 | 45 | text-align: right; 46 | float: right; 47 | padding-top: 9px; 48 | font-size: 85%; 49 | letter-spacing: 1px; 50 | line-height: 1em; 51 | font-weight: 600; 52 | margin: 0; 53 | padding: 0; 54 | list-style-type: none; 55 | text-transform: uppercase; 56 | font-family: 'Titillium Web', sans-serif; 57 | 58 | } 59 | 60 | .site-nav .menu > li { 61 | border-bottom: 3px solid transparent; 62 | display: inline-block; 63 | height: 23px; 64 | line-height: normal; 65 | margin: 12px 0 0 20px; 66 | padding: 0 0 2px 0; 67 | position: relative; 68 | vertical-align: top; 69 | } 70 | 71 | .site-nav a { 72 | display: block; 73 | color: #ffffff; 74 | } 75 | 76 | /* Sub Menu */ 77 | 78 | .site-nav .sub-menu a { 79 | display: block; 80 | font-weight: normal; 81 | height: auto; 82 | letter-spacing: 0; 83 | line-height: 1.2em; 84 | padding: 4px 10px; 85 | color: #522d80; 86 | 87 | } 88 | 89 | .site-nav .sub-menu a:hover { 90 | color: $clemson-purple; 91 | } 92 | .site-nav .sub-menu { 93 | background: #ffffff; 94 | border-color: $clemson-purple; 95 | min-width: 265px; 96 | 97 | z-index:2147483647; 98 | } 99 | .site-nav .sub-menu li.current-menu-item > a { 100 | border-left-color: $clemson-purple; 101 | border-right-color: $clemson-purple; 102 | border-right: 0px; 103 | 104 | } 105 | 106 | 107 | .sub-menu { 108 | border: 3px solid transparent; 109 | border-top: 0; 110 | /* bg and border colors set in header */ 111 | box-shadow: 0 2px 2px rgba(0,0,0,0.4); 112 | -moz-box-shadow: 0 2px 2px rgba(0,0,0,0.4); 113 | -webkit-box-shadow: 0 2px 2px rgba(0,0,0,0.4); 114 | display: none; 115 | right: -10px; 116 | padding: 4px 0 3px 0; 117 | position: absolute; 118 | text-align: left; 119 | text-transform: none; 120 | top: 28px; 121 | min-width: 265px; 122 | 123 | z-index:999; 124 | font-family: Helvetica, Arial, Verdana, sans-serif; 125 | 126 | } 127 | 128 | .sub-menu li { 129 | border-bottom: 0; 130 | display: block; 131 | height: auto; 132 | margin: 3px 0; 133 | padding: 0; 134 | text-align: left; 135 | } 136 | 137 | .site-nav li:hover > .sub-menu { 138 | display: block; 139 | } 140 | 141 | 142 | 143 | .site-nav h1 { 144 | position: absolute; 145 | left: -999em; 146 | } 147 | 148 | 149 | .site-nav { 150 | float: right; 151 | line-height: 40px; 152 | 153 | 154 | .menu-icon { 155 | display: none; 156 | } 157 | 158 | .page-link { 159 | color: #ffffff; 160 | background: $clemson-purple; 161 | line-height: $base-line-height; 162 | 163 | // Gaps between nav items, but not on the first one 164 | &:not(:first-child) { 165 | margin-left: 20px; 166 | } 167 | } 168 | 169 | 170 | 171 | @include media-query($on-palm) { 172 | position: absolute; 173 | top: 9px; 174 | right: 30px; 175 | background-color: $background-color; 176 | border: 1px solid $grey-color-light; 177 | border-radius: 5px; 178 | text-align: right; 179 | 180 | .menu-icon { 181 | display: block; 182 | float: right; 183 | width: 36px; 184 | height: 26px; 185 | line-height: 0; 186 | padding-top: 10px; 187 | text-align: center; 188 | 189 | > svg { 190 | width: 18px; 191 | height: 15px; 192 | 193 | path { 194 | fill: $grey-color-dark; 195 | } 196 | } 197 | } 198 | 199 | .trigger { 200 | clear: both; 201 | display: none; 202 | } 203 | 204 | &:hover .trigger { 205 | display: block; 206 | padding-bottom: 5px; 207 | } 208 | 209 | .page-link { 210 | display: block; 211 | padding: 5px 10px; 212 | } 213 | } 214 | } 215 | 216 | 217 | -------------------------------------------------------------------------------- /_sass/_layout.scss: -------------------------------------------------------------------------------- 1 | 2 | 3 | /* .site-nav { 4 | float: right; 5 | line-height: 40px; 6 | margin-top: 15px; 7 | 8 | .menu-icon { 9 | display: none; 10 | } 11 | 12 | .page-link { 13 | color: #ffffff; 14 | background: #f66733; 15 | line-height: $base-line-height; 16 | 17 | // Gaps between nav items, but not on the first one 18 | &:not(:first-child) { 19 | margin-left: 20px; 20 | } 21 | } 22 | 23 | 24 | 25 | @include media-query($on-palm) { 26 | position: absolute; 27 | top: 9px; 28 | right: 30px; 29 | background-color: $background-color; 30 | border: 1px solid $grey-color-light; 31 | border-radius: 5px; 32 | text-align: right; 33 | 34 | .menu-icon { 35 | display: block; 36 | float: right; 37 | width: 36px; 38 | height: 26px; 39 | line-height: 0; 40 | padding-top: 10px; 41 | text-align: center; 42 | 43 | > svg { 44 | width: 18px; 45 | height: 15px; 46 | 47 | path { 48 | fill: $grey-color-dark; 49 | } 50 | } 51 | } 52 | 53 | .trigger { 54 | clear: both; 55 | display: none; 56 | } 57 | 58 | &:hover .trigger { 59 | display: block; 60 | padding-bottom: 5px; 61 | } 62 | 63 | .page-link { 64 | display: block; 65 | padding: 5px 10px; 66 | } 67 | } 68 | } 69 | */ 70 | 71 | 72 | 73 | /** 74 | * Site footer 75 | */ 76 | .site-footer { 77 | border-top: 1px solid $grey-color-light; 78 | padding: $spacing-unit 0; 79 | } 80 | 81 | .footer-heading { 82 | font-size: 18px; 83 | margin-bottom: $spacing-unit / 2; 84 | } 85 | 86 | .contact-list, 87 | .social-media-list { 88 | list-style: none; 89 | margin-left: 0; 90 | } 91 | 92 | .footer-col-wrapper { 93 | font-size: 15px; 94 | color: $grey-color; 95 | margin-left: -$spacing-unit / 2; 96 | @extend %clearfix; 97 | } 98 | 99 | .footer-col { 100 | float: left; 101 | margin-bottom: $spacing-unit / 2; 102 | padding-left: $spacing-unit / 2; 103 | } 104 | 105 | .footer-col-1 { 106 | width: -webkit-calc(25% - (#{$spacing-unit} / 2)); 107 | width: calc(25% - (#{$spacing-unit} / 2)); 108 | } 109 | 110 | .footer-col-2 { 111 | width: -webkit-calc(50% - (#{$spacing-unit} / 2)); 112 | width: calc(50% - (#{$spacing-unit} / 2)); 113 | } 114 | 115 | .footer-col-3 { 116 | width: -webkit-calc(25% - (#{$spacing-unit} / 2)); 117 | width: calc(25% - (#{$spacing-unit} / 2)); 118 | } 119 | 120 | @include media-query($on-laptop) { 121 | .footer-col-1, 122 | .footer-col-2 { 123 | width: -webkit-calc(50% - (#{$spacing-unit} / 2)); 124 | width: calc(50% - (#{$spacing-unit} / 2)); 125 | } 126 | 127 | .footer-col-3 { 128 | width: -webkit-calc(100% - (#{$spacing-unit} / 2)); 129 | width: calc(100% - (#{$spacing-unit} / 2)); 130 | } 131 | } 132 | 133 | @include media-query($on-palm) { 134 | .footer-col { 135 | float: none; 136 | width: -webkit-calc(100% - (#{$spacing-unit} / 2)); 137 | width: calc(100% - (#{$spacing-unit} / 2)); 138 | } 139 | } 140 | 141 | 142 | 143 | /** 144 | * Page content 145 | */ 146 | .page-content { 147 | padding: $spacing-unit 0; 148 | } 149 | 150 | .page-heading { 151 | font-size: 20px; 152 | } 153 | 154 | .post-list { 155 | margin-left: 0; 156 | list-style: none; 157 | 158 | > li { 159 | margin-bottom: $spacing-unit; 160 | } 161 | } 162 | 163 | .post-meta { 164 | font-size: $small-font-size; 165 | color: $grey-color; 166 | } 167 | 168 | .post-link { 169 | display: block; 170 | font-size: 24px; 171 | } 172 | 173 | 174 | 175 | /** 176 | * Posts 177 | */ 178 | .post-header { 179 | margin-bottom: $spacing-unit; 180 | } 181 | 182 | h1 /* .post-title */ { 183 | /* font-size: 42px; */ 184 | letter-spacing: -1px; 185 | line-height: 1; 186 | font-family: 'Titillium Web', sans-serif; 187 | color: #522d80; 188 | 189 | @include media-query($on-laptop) { 190 | /* font-size: 36px; */ 191 | } 192 | } 193 | 194 | .post-content { 195 | margin-bottom: $spacing-unit; 196 | 197 | h2 { 198 | font-family: 'Titillium Web', sans-serif; 199 | font-weight: 500; 200 | /* font-size: 32px; */ 201 | 202 | @include media-query($on-laptop) { 203 | /* font-size: 28px; */ 204 | } 205 | } 206 | 207 | h3 { 208 | font-style: italic; 209 | /* font-size: 26px; */ 210 | 211 | @include media-query($on-laptop) { 212 | /* font-size: 22px; */ 213 | } 214 | } 215 | 216 | h4 { 217 | /* font-size: 20px; */ 218 | 219 | @include media-query($on-laptop) { 220 | /* font-size: 18px; */ 221 | } 222 | } 223 | } 224 | 225 | .footnotes ol li {list-style-type:decimal;} 226 | .footnotes ol {font-size:.85em; color:#666666;} 227 | 228 | html { 229 | overflow-y: scroll; 230 | } 231 | 232 | ul.listing { 233 | list-style-type: none; 234 | margin-left: 0px; 235 | } 236 | 237 | ul.listing li.listing-seperator { 238 | padding-top: 15px; 239 | font-weight: bold; 240 | font-family: 'Titillium Web', sans-serif; 241 | font-size: 1.17em; 242 | } 243 | 244 | ul.listing li.listing-item time { 245 | 246 | color: #333; 247 | font-weight: 500; 248 | text-transform: uppercase; 249 | padding-right: 10px; 250 | } 251 | 252 | ul.listing li.listing-item a { 253 | color: $clemson-purple; 254 | font-weight: 400; 255 | font-family: 'Titillium Web', sans-serif; 256 | } 257 | 258 | 259 | /*------ archive type stuff ------ */ 260 | 261 | ul#archive { 262 | list-style-type: none; 263 | margin: 0 0 1em 0; 264 | padding: 0; 265 | } 266 | 267 | ul#archive li { 268 | border-top: #999 1px dotted; 269 | border-bottom: #999 1px dotted; 270 | padding: .1em 0 .1em .5em; 271 | background: #fff; 272 | } 273 | 274 | ul#archive h2 { 275 | padding-top: .5em } 276 | 277 | ul#archive li.alt { 278 | background: #f6f6f6; 279 | } 280 | 281 | .archiveposturl { 282 | display: block; 283 | 284 | color: #333; 285 | } 286 | 287 | .archiveposturl:hover { 288 | 289 | } 290 | 291 | ul#archive li span a { 292 | color: $clemson-purple; 293 | font-weight: bold; 294 | font-family: 'Titillium Web', sans-serif; 295 | } 296 | 297 | 298 | ul#archive li span.postlower { 299 | font-size: 85% 300 | 301 | } 302 | 303 | ul#archive li span.postlower a { 304 | color: #07c; 305 | font-weight: normal; 306 | font-family: "Open Sans", Helvetica, Arial, sans-serif; 307 | 308 | } 309 | 310 | article ul { 311 | list-style-type: none; 312 | } 313 | 314 | article ul > li:before { 315 | content: "–"; /* en dash */ 316 | position: absolute; 317 | margin-left: -1.1em; 318 | } 319 | 320 | article ul#archive > li:before { 321 | list-style-type: none; 322 | content: none; 323 | } 324 | 325 | 326 | /* ul#archive li span { 327 | color: #000; 328 | font-size: 85%; 329 | } 330 | 331 | 332 | 333 | ul#archive li span a:hover { 334 | border-bottom: #bdbdbd 1px solid; 335 | } */ 336 | -------------------------------------------------------------------------------- /lectures/lec12_side_effects/heap2.svg: -------------------------------------------------------------------------------- 1 | 2 |
x
[Not supported by viewer]
z
[Not supported by viewer]
10
[Not supported by viewer]
y
[Not supported by viewer]
10
[Not supported by viewer]
-------------------------------------------------------------------------------- /Gemfile.lock: -------------------------------------------------------------------------------- 1 | PATH 2 | remote: . 3 | specs: 4 | ipa (0.1.0) 5 | jekyll (~> 3.6) 6 | 7 | GEM 8 | remote: https://rubygems.org/ 9 | specs: 10 | activesupport (8.0.2) 11 | base64 12 | benchmark (>= 0.3) 13 | bigdecimal 14 | concurrent-ruby (~> 1.0, >= 1.3.1) 15 | connection_pool (>= 2.2.5) 16 | drb 17 | i18n (>= 1.6, < 2) 18 | logger (>= 1.4.2) 19 | minitest (>= 5.1) 20 | securerandom (>= 0.3) 21 | tzinfo (~> 2.0, >= 2.0.5) 22 | uri (>= 0.13.1) 23 | addressable (2.8.7) 24 | public_suffix (>= 2.0.2, < 7.0) 25 | base64 (0.2.0) 26 | benchmark (0.4.1) 27 | bigdecimal (3.2.2) 28 | coffee-script (2.4.1) 29 | coffee-script-source 30 | execjs 31 | coffee-script-source (1.12.2) 32 | colorator (1.1.0) 33 | commonmarker (0.23.11) 34 | concurrent-ruby (1.3.5) 35 | connection_pool (2.5.3) 36 | csv (3.3.5) 37 | dnsruby (1.72.4) 38 | base64 (~> 0.2.0) 39 | logger (~> 1.6.5) 40 | simpleidn (~> 0.2.1) 41 | drb (2.2.3) 42 | em-websocket (0.5.3) 43 | eventmachine (>= 0.12.9) 44 | http_parser.rb (~> 0) 45 | ethon (0.16.0) 46 | ffi (>= 1.15.0) 47 | eventmachine (1.2.7) 48 | execjs (2.10.0) 49 | faraday (2.13.4) 50 | faraday-net_http (>= 2.0, < 3.5) 51 | json 52 | logger 53 | faraday-net_http (3.4.1) 54 | net-http (>= 0.5.0) 55 | ffi (1.17.2-aarch64-linux-gnu) 56 | ffi (1.17.2-aarch64-linux-musl) 57 | ffi (1.17.2-arm-linux-gnu) 58 | ffi (1.17.2-arm-linux-musl) 59 | ffi (1.17.2-arm64-darwin) 60 | ffi (1.17.2-x86_64-darwin) 61 | ffi (1.17.2-x86_64-linux-gnu) 62 | ffi (1.17.2-x86_64-linux-musl) 63 | forwardable-extended (2.6.0) 64 | gemoji (4.1.0) 65 | github-pages (232) 66 | github-pages-health-check (= 1.18.2) 67 | jekyll (= 3.10.0) 68 | jekyll-avatar (= 0.8.0) 69 | jekyll-coffeescript (= 1.2.2) 70 | jekyll-commonmark-ghpages (= 0.5.1) 71 | jekyll-default-layout (= 0.1.5) 72 | jekyll-feed (= 0.17.0) 73 | jekyll-gist (= 1.5.0) 74 | jekyll-github-metadata (= 2.16.1) 75 | jekyll-include-cache (= 0.2.1) 76 | jekyll-mentions (= 1.6.0) 77 | jekyll-optional-front-matter (= 0.3.2) 78 | jekyll-paginate (= 1.1.0) 79 | jekyll-readme-index (= 0.3.0) 80 | jekyll-redirect-from (= 0.16.0) 81 | jekyll-relative-links (= 0.6.1) 82 | jekyll-remote-theme (= 0.4.3) 83 | jekyll-sass-converter (= 1.5.2) 84 | jekyll-seo-tag (= 2.8.0) 85 | jekyll-sitemap (= 1.4.0) 86 | jekyll-swiss (= 1.0.0) 87 | jekyll-theme-architect (= 0.2.0) 88 | jekyll-theme-cayman (= 0.2.0) 89 | jekyll-theme-dinky (= 0.2.0) 90 | jekyll-theme-hacker (= 0.2.0) 91 | jekyll-theme-leap-day (= 0.2.0) 92 | jekyll-theme-merlot (= 0.2.0) 93 | jekyll-theme-midnight (= 0.2.0) 94 | jekyll-theme-minimal (= 0.2.0) 95 | jekyll-theme-modernist (= 0.2.0) 96 | jekyll-theme-primer (= 0.6.0) 97 | jekyll-theme-slate (= 0.2.0) 98 | jekyll-theme-tactile (= 0.2.0) 99 | jekyll-theme-time-machine (= 0.2.0) 100 | jekyll-titles-from-headings (= 0.5.3) 101 | jemoji (= 0.13.0) 102 | kramdown (= 2.4.0) 103 | kramdown-parser-gfm (= 1.1.0) 104 | liquid (= 4.0.4) 105 | mercenary (~> 0.3) 106 | minima (= 2.5.1) 107 | nokogiri (>= 1.16.2, < 2.0) 108 | rouge (= 3.30.0) 109 | terminal-table (~> 1.4) 110 | webrick (~> 1.8) 111 | github-pages-health-check (1.18.2) 112 | addressable (~> 2.3) 113 | dnsruby (~> 1.60) 114 | octokit (>= 4, < 8) 115 | public_suffix (>= 3.0, < 6.0) 116 | typhoeus (~> 1.3) 117 | html-pipeline (2.14.3) 118 | activesupport (>= 2) 119 | nokogiri (>= 1.4) 120 | http_parser.rb (0.8.0) 121 | i18n (1.14.7) 122 | concurrent-ruby (~> 1.0) 123 | jekyll (3.10.0) 124 | addressable (~> 2.4) 125 | colorator (~> 1.0) 126 | csv (~> 3.0) 127 | em-websocket (~> 0.5) 128 | i18n (>= 0.7, < 2) 129 | jekyll-sass-converter (~> 1.0) 130 | jekyll-watch (~> 2.0) 131 | kramdown (>= 1.17, < 3) 132 | liquid (~> 4.0) 133 | mercenary (~> 0.3.3) 134 | pathutil (~> 0.9) 135 | rouge (>= 1.7, < 4) 136 | safe_yaml (~> 1.0) 137 | webrick (>= 1.0) 138 | jekyll-avatar (0.8.0) 139 | jekyll (>= 3.0, < 5.0) 140 | jekyll-coffeescript (1.2.2) 141 | coffee-script (~> 2.2) 142 | coffee-script-source (~> 1.12) 143 | jekyll-commonmark (1.4.0) 144 | commonmarker (~> 0.22) 145 | jekyll-commonmark-ghpages (0.5.1) 146 | commonmarker (>= 0.23.7, < 1.1.0) 147 | jekyll (>= 3.9, < 4.0) 148 | jekyll-commonmark (~> 1.4.0) 149 | rouge (>= 2.0, < 5.0) 150 | jekyll-default-layout (0.1.5) 151 | jekyll (>= 3.0, < 5.0) 152 | jekyll-feed (0.17.0) 153 | jekyll (>= 3.7, < 5.0) 154 | jekyll-gist (1.5.0) 155 | octokit (~> 4.2) 156 | jekyll-github-metadata (2.16.1) 157 | jekyll (>= 3.4, < 5.0) 158 | octokit (>= 4, < 7, != 4.4.0) 159 | jekyll-include-cache (0.2.1) 160 | jekyll (>= 3.7, < 5.0) 161 | jekyll-mentions (1.6.0) 162 | html-pipeline (~> 2.3) 163 | jekyll (>= 3.7, < 5.0) 164 | jekyll-optional-front-matter (0.3.2) 165 | jekyll (>= 3.0, < 5.0) 166 | jekyll-paginate (1.1.0) 167 | jekyll-readme-index (0.3.0) 168 | jekyll (>= 3.0, < 5.0) 169 | jekyll-redirect-from (0.16.0) 170 | jekyll (>= 3.3, < 5.0) 171 | jekyll-relative-links (0.6.1) 172 | jekyll (>= 3.3, < 5.0) 173 | jekyll-remote-theme (0.4.3) 174 | addressable (~> 2.0) 175 | jekyll (>= 3.5, < 5.0) 176 | jekyll-sass-converter (>= 1.0, <= 3.0.0, != 2.0.0) 177 | rubyzip (>= 1.3.0, < 3.0) 178 | jekyll-sass-converter (1.5.2) 179 | sass (~> 3.4) 180 | jekyll-seo-tag (2.8.0) 181 | jekyll (>= 3.8, < 5.0) 182 | jekyll-sitemap (1.4.0) 183 | jekyll (>= 3.7, < 5.0) 184 | jekyll-swiss (1.0.0) 185 | jekyll-theme-architect (0.2.0) 186 | jekyll (> 3.5, < 5.0) 187 | jekyll-seo-tag (~> 2.0) 188 | jekyll-theme-cayman (0.2.0) 189 | jekyll (> 3.5, < 5.0) 190 | jekyll-seo-tag (~> 2.0) 191 | jekyll-theme-dinky (0.2.0) 192 | jekyll (> 3.5, < 5.0) 193 | jekyll-seo-tag (~> 2.0) 194 | jekyll-theme-hacker (0.2.0) 195 | jekyll (> 3.5, < 5.0) 196 | jekyll-seo-tag (~> 2.0) 197 | jekyll-theme-leap-day (0.2.0) 198 | jekyll (> 3.5, < 5.0) 199 | jekyll-seo-tag (~> 2.0) 200 | jekyll-theme-merlot (0.2.0) 201 | jekyll (> 3.5, < 5.0) 202 | jekyll-seo-tag (~> 2.0) 203 | jekyll-theme-midnight (0.2.0) 204 | jekyll (> 3.5, < 5.0) 205 | jekyll-seo-tag (~> 2.0) 206 | jekyll-theme-minimal (0.2.0) 207 | jekyll (> 3.5, < 5.0) 208 | jekyll-seo-tag (~> 2.0) 209 | jekyll-theme-modernist (0.2.0) 210 | jekyll (> 3.5, < 5.0) 211 | jekyll-seo-tag (~> 2.0) 212 | jekyll-theme-primer (0.6.0) 213 | jekyll (> 3.5, < 5.0) 214 | jekyll-github-metadata (~> 2.9) 215 | jekyll-seo-tag (~> 2.0) 216 | jekyll-theme-slate (0.2.0) 217 | jekyll (> 3.5, < 5.0) 218 | jekyll-seo-tag (~> 2.0) 219 | jekyll-theme-tactile (0.2.0) 220 | jekyll (> 3.5, < 5.0) 221 | jekyll-seo-tag (~> 2.0) 222 | jekyll-theme-time-machine (0.2.0) 223 | jekyll (> 3.5, < 5.0) 224 | jekyll-seo-tag (~> 2.0) 225 | jekyll-titles-from-headings (0.5.3) 226 | jekyll (>= 3.3, < 5.0) 227 | jekyll-watch (2.2.1) 228 | listen (~> 3.0) 229 | jemoji (0.13.0) 230 | gemoji (>= 3, < 5) 231 | html-pipeline (~> 2.2) 232 | jekyll (>= 3.0, < 5.0) 233 | json (2.13.2) 234 | kramdown (2.4.0) 235 | rexml 236 | kramdown-parser-gfm (1.1.0) 237 | kramdown (~> 2.0) 238 | liquid (4.0.4) 239 | listen (3.9.0) 240 | rb-fsevent (~> 0.10, >= 0.10.3) 241 | rb-inotify (~> 0.9, >= 0.9.10) 242 | logger (1.6.6) 243 | mercenary (0.3.6) 244 | minima (2.5.1) 245 | jekyll (>= 3.5, < 5.0) 246 | jekyll-feed (~> 0.9) 247 | jekyll-seo-tag (~> 2.1) 248 | minitest (5.25.5) 249 | net-http (0.6.0) 250 | uri 251 | nokogiri (1.18.9-aarch64-linux-gnu) 252 | racc (~> 1.4) 253 | nokogiri (1.18.9-aarch64-linux-musl) 254 | racc (~> 1.4) 255 | nokogiri (1.18.9-arm-linux-gnu) 256 | racc (~> 1.4) 257 | nokogiri (1.18.9-arm-linux-musl) 258 | racc (~> 1.4) 259 | nokogiri (1.18.9-arm64-darwin) 260 | racc (~> 1.4) 261 | nokogiri (1.18.9-x86_64-darwin) 262 | racc (~> 1.4) 263 | nokogiri (1.18.9-x86_64-linux-gnu) 264 | racc (~> 1.4) 265 | nokogiri (1.18.9-x86_64-linux-musl) 266 | racc (~> 1.4) 267 | octokit (4.25.1) 268 | faraday (>= 1, < 3) 269 | sawyer (~> 0.9) 270 | pathutil (0.16.2) 271 | forwardable-extended (~> 2.6) 272 | public_suffix (5.1.1) 273 | racc (1.8.1) 274 | rake (12.3.3) 275 | rb-fsevent (0.11.2) 276 | rb-inotify (0.11.1) 277 | ffi (~> 1.0) 278 | rexml (3.4.1) 279 | rouge (3.30.0) 280 | rubyzip (2.4.1) 281 | safe_yaml (1.0.5) 282 | sass (3.7.4) 283 | sass-listen (~> 4.0.0) 284 | sass-listen (4.0.0) 285 | rb-fsevent (~> 0.9, >= 0.9.4) 286 | rb-inotify (~> 0.9, >= 0.9.7) 287 | sawyer (0.9.2) 288 | addressable (>= 2.3.5) 289 | faraday (>= 0.17.3, < 3) 290 | securerandom (0.4.1) 291 | simpleidn (0.2.3) 292 | terminal-table (1.8.0) 293 | unicode-display_width (~> 1.1, >= 1.1.1) 294 | typhoeus (1.4.1) 295 | ethon (>= 0.9.0) 296 | tzinfo (2.0.6) 297 | concurrent-ruby (~> 1.0) 298 | unicode-display_width (1.8.0) 299 | uri (1.0.3) 300 | webrick (1.9.1) 301 | 302 | PLATFORMS 303 | aarch64-linux-gnu 304 | aarch64-linux-musl 305 | arm-linux-gnu 306 | arm-linux-musl 307 | arm64-darwin 308 | x86_64-darwin 309 | x86_64-linux-gnu 310 | x86_64-linux-musl 311 | 312 | DEPENDENCIES 313 | github-pages 314 | ipa! 315 | rake (~> 12.3) 316 | 317 | BUNDLED WITH 318 | 2.7.1 319 | -------------------------------------------------------------------------------- /lectures/lec02_why_fp/lec2_why_functional_programming.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": { 6 | "slideshow": { 7 | "slide_type": "slide" 8 | } 9 | }, 10 | "source": [ 11 | "
\n", 12 | "

Functional Programming

\n", 13 | "

CS3100 Monsoon 2020

\n", 14 | "
" 15 | ] 16 | }, 17 | { 18 | "cell_type": "markdown", 19 | "metadata": { 20 | "slideshow": { 21 | "slide_type": "slide" 22 | } 23 | }, 24 | "source": [ 25 | "## Recap\n", 26 | "\n", 27 | "

Last Time:

\n", 28 | "\n", 29 | "* Why study programming languages?\n", 30 | "\n", 31 | "

Today:

\n", 32 | "\n", 33 | "* Why functional programming matters?" 34 | ] 35 | }, 36 | { 37 | "cell_type": "markdown", 38 | "metadata": { 39 | "slideshow": { 40 | "slide_type": "notes" 41 | } 42 | }, 43 | "source": [ 44 | "See also the famous paper titled [\"Why Functional Programming Matters?\"](https://www.cs.kent.ac.uk/people/staff/dat/miranda/whyfp90.pdf) by John Huges." 45 | ] 46 | }, 47 | { 48 | "cell_type": "markdown", 49 | "metadata": { 50 | "slideshow": { 51 | "slide_type": "slide" 52 | } 53 | }, 54 | "source": [ 55 | "## In this part of the course, we will learn\n", 56 | "\n", 57 | "
\n", 58 | "

🌟🌟 Functional Programming 🌟🌟

\n", 59 | "
" 60 | ] 61 | }, 62 | { 63 | "cell_type": "markdown", 64 | "metadata": { 65 | "slideshow": { 66 | "slide_type": "fragment" 67 | } 68 | }, 69 | "source": [ 70 | "
\n", 71 | "\n", 72 | "\"What\n", 73 | "
" 74 | ] 75 | }, 76 | { 77 | "cell_type": "markdown", 78 | "metadata": { 79 | "jp-MarkdownHeadingCollapsed": true, 80 | "slideshow": { 81 | "slide_type": "slide" 82 | } 83 | }, 84 | "source": [ 85 | "## What is a functional language?\n", 86 | "\n", 87 | "A functional language:\n", 88 | "\n", 89 | "* prefers computations as **mathematical functions**\n", 90 | "* prefers to avoid **mutable state**\n", 91 | "\n", 92 | "**State:** information maintained by a computation\n", 93 | "\n", 94 | "**Mutable:** can be changed (antonym: *immutable*)" 95 | ] 96 | }, 97 | { 98 | "cell_type": "markdown", 99 | "metadata": { 100 | "slideshow": { 101 | "slide_type": "slide" 102 | } 103 | }, 104 | "source": [ 105 | "## Mutability\n", 106 | "\n", 107 | "**The fantasy of mutability:**\n", 108 | "* It's easy to reason about: the machine does this, then this..." 109 | ] 110 | }, 111 | { 112 | "cell_type": "markdown", 113 | "metadata": { 114 | "slideshow": { 115 | "slide_type": "fragment" 116 | } 117 | }, 118 | "source": [ 119 | "**The reality of mutability:**\n", 120 | "* Machines are good at complicated manipulation of state\n", 121 | "* Humans are not good at understanding it!\n", 122 | "\n", 123 | "Mutability breaks **referential transparency** -- ability to replace expression with another without affecting result of computation" 124 | ] 125 | }, 126 | { 127 | "cell_type": "markdown", 128 | "metadata": { 129 | "jp-MarkdownHeadingCollapsed": true, 130 | "slideshow": { 131 | "slide_type": "slide" 132 | } 133 | }, 134 | "source": [ 135 | "## Imperative programming\n", 136 | "\n", 137 | "Commands specify *how to compute* by destructively changing state:\n", 138 | "\n", 139 | "```c\n", 140 | "x = x+1;\n", 141 | "a[i] = 42;\n", 142 | "p->next = p->next->next;\n", 143 | "```\n", 144 | "\n", 145 | "Functions/methods have **side effects**:\n", 146 | "\n", 147 | "```c\n", 148 | "int x = 0;\n", 149 | "int incr_x () {\n", 150 | " x++;\n", 151 | " return x;\n", 152 | "}\n", 153 | "```" 154 | ] 155 | }, 156 | { 157 | "cell_type": "markdown", 158 | "metadata": { 159 | "jp-MarkdownHeadingCollapsed": true, 160 | "slideshow": { 161 | "slide_type": "slide" 162 | } 163 | }, 164 | "source": [ 165 | "## Functional Programming \n", 166 | "\n", 167 | "**Expressions** specify *what to compute*\n", 168 | "* Variables never change value\n", 169 | "* Functional never have side effects\n", 170 | "\n", 171 | "The power of immutability:\n", 172 | "* No need to think about state\n", 173 | "* Powerful ways to build (and reason about) correct programs" 174 | ] 175 | }, 176 | { 177 | "cell_type": "markdown", 178 | "metadata": { 179 | "slideshow": { 180 | "slide_type": "slide" 181 | } 182 | }, 183 | "source": [ 184 | "## Why study functional programming?\n", 185 | "\n", 186 | "1. Functional programming languages predict the future." 187 | ] 188 | }, 189 | { 190 | "cell_type": "markdown", 191 | "metadata": { 192 | "slideshow": { 193 | "slide_type": "slide" 194 | } 195 | }, 196 | "source": [ 197 | "## 1. Functional programming languages predict the future\n", 198 | "\n", 199 | "* Garbage collection\n", 200 | " + Java [1995], LISP [1958]\n", 201 | "* Generics\n", 202 | " + Java 5 [2004], ML [1990]\n", 203 | "* Higher-order functions\n", 204 | " + C#3.0 [2007], Java 8 [2014], LISP [1958]\n", 205 | "* Type inference\n", 206 | " + C++11 [2011], Java 7 [2011] and 8, ML [1990]\n", 207 | "* **What's next?**" 208 | ] 209 | }, 210 | { 211 | "cell_type": "markdown", 212 | "metadata": { 213 | "slideshow": { 214 | "slide_type": "slide" 215 | } 216 | }, 217 | "source": [ 218 | "## Why study functional programming?\n", 219 | "\n", 220 | "1. Functional programming languages predict the future.\n", 221 | "2. Functional programming languages are *sometimes* used in the industry." 222 | ] 223 | }, 224 | { 225 | "cell_type": "markdown", 226 | "metadata": { 227 | "slideshow": { 228 | "slide_type": "slide" 229 | } 230 | }, 231 | "source": [ 232 | "## 2. Functional Programmming in Industry\n", 233 | "\n", 234 | "* Java 8 -- Oracle\n", 235 | "* F#, C# 3.0, LINQ -- Microsoft\n", 236 | "* Scala -- Twitter, Foursquare, LinkedIn\n", 237 | "* Haskell -- Facebook, Barclays, AT&T, Mercury\n", 238 | "* Erlang -- Facebook, Amazon, WhatsApp\n", 239 | "* OCaml -- Facebook, Bloomberg, Citrix, JaneStreet, Tezos Blockchain " 240 | ] 241 | }, 242 | { 243 | "cell_type": "markdown", 244 | "metadata": { 245 | "slideshow": { 246 | "slide_type": "slide" 247 | } 248 | }, 249 | "source": [ 250 | "## Why study functional programming?\n", 251 | "\n", 252 | "1. Functional programming languages predict the future.\n", 253 | "2. Functional programming languages are *sometimes* used in the industry.\n", 254 | "3. Functional programming languages are **elegant**. " 255 | ] 256 | }, 257 | { 258 | "cell_type": "markdown", 259 | "metadata": { 260 | "slideshow": { 261 | "slide_type": "slide" 262 | } 263 | }, 264 | "source": [ 265 | "## Does aesthetics matter?\n", 266 | "\n", 267 | "You'll often hear that functional programming code is beautiful, concise, stylish, refined, etc. But does it matter?" 268 | ] 269 | }, 270 | { 271 | "cell_type": "markdown", 272 | "metadata": { 273 | "slideshow": { 274 | "slide_type": "fragment" 275 | } 276 | }, 277 | "source": [ 278 | "

YES!

\n", 279 | "\n", 280 | "* Who reads code?\n", 281 | " + Machines\n", 282 | " + Humans\n", 283 | "* Elegant code is easier to read and maintain\n", 284 | "* Elegant code might (not) be easier to write" 285 | ] 286 | }, 287 | { 288 | "cell_type": "markdown", 289 | "metadata": { 290 | "slideshow": { 291 | "slide_type": "slide" 292 | } 293 | }, 294 | "source": [ 295 | "## OCaml\n", 296 | "\n", 297 | "* A pretty good language for writing beautiful programs.\n", 298 | "* O=Objective, Caml=not important.\n", 299 | "* ML is a family of languages; originally the \"meta-language\" for verifying programs\n", 300 | "\n", 301 | "
\n", 302 | "\n", 303 | "\"OCaml\"\n", 304 | "
\n" 305 | ] 306 | }, 307 | { 308 | "cell_type": "markdown", 309 | "metadata": { 310 | "slideshow": { 311 | "slide_type": "slide" 312 | } 313 | }, 314 | "source": [ 315 | "## OCaml is awesome\n", 316 | "\n", 317 | "* Immutable programming\n", 318 | "* Algebraic datatypes and pattern matching\n", 319 | "* First-class functions\n", 320 | "* Static type-checking\n", 321 | "* Automatic type inference\n", 322 | "* Parametric polymorphism\n", 323 | "* Garbage collection\n", 324 | "* Modules\n", 325 | " \n", 326 | "

But no language is perfect...

" 327 | ] 328 | }, 329 | { 330 | "cell_type": "markdown", 331 | "metadata": { 332 | "slideshow": { 333 | "slide_type": "notes" 334 | } 335 | }, 336 | "source": [ 337 | "* Immutable programming\n", 338 | " + Variable’s values cannot destructively be changed; makes reasoning about program easier!\n", 339 | "* Algebraic datatypes and pattern matching\n", 340 | " + Makes definition and manipulation of complex data structures easy to express\n", 341 | "* First-class functions\n", 342 | " + Functions can be passed around like ordinary values\n", 343 | "* Static type-checking\n", 344 | " + Reduce number of run-time errors\n", 345 | "* Automatic type inference\n", 346 | " + No burden to write down types of every single variable\n", 347 | "* Parametric polymorphism\n", 348 | " + Enables construction of abstractions that work across many data types\n", 349 | "* Garbage collection\n", 350 | " + Automated memory management eliminates many run-time errors\n", 351 | "* Modules\n", 352 | " + Advanced system for structuring large systems" 353 | ] 354 | }, 355 | { 356 | "cell_type": "markdown", 357 | "metadata": { 358 | "slideshow": { 359 | "slide_type": "slide" 360 | } 361 | }, 362 | "source": [ 363 | "## Languages are tools\n", 364 | "\n", 365 | "* There's no universally perfect tool\n", 366 | " + There's no universally perfect language\n", 367 | "* OCaml is good for this course because:\n", 368 | " + good mix of functional & imperative features\n", 369 | " + relatively easy to reason about meaning of programs\n", 370 | "* But OCaml isn't perfect\n", 371 | " + there will be features you miss from language X\n", 372 | " + there will be annoyances based on your expectations – **keep an open mind, try to have fun**" 373 | ] 374 | }, 375 | { 376 | "cell_type": "markdown", 377 | "metadata": { 378 | "slideshow": { 379 | "slide_type": "slide" 380 | } 381 | }, 382 | "source": [ 383 | "
\n", 384 | "

Fin.

\n", 385 | "
" 386 | ] 387 | } 388 | ], 389 | "metadata": { 390 | "celltoolbar": "Slideshow", 391 | "kernelspec": { 392 | "display_name": "OCaml 4.14.2", 393 | "language": "OCaml", 394 | "name": "ocaml-jupyter" 395 | }, 396 | "language_info": { 397 | "codemirror_mode": "text/x-ocaml", 398 | "file_extension": ".ml", 399 | "mimetype": "text/x-ocaml", 400 | "name": "OCaml", 401 | "nbconverter_exporter": null, 402 | "pygments_lexer": "OCaml", 403 | "version": "4.14.2" 404 | } 405 | }, 406 | "nbformat": 4, 407 | "nbformat_minor": 4 408 | } 409 | -------------------------------------------------------------------------------- /lectures/lec04_functions/images/stack1.svg: -------------------------------------------------------------------------------- 1 | 2 |
+ 5
[Not supported by viewer]
sum_of_first_n 5
sum_of_first_n 5
+ 4
[Not supported by viewer]
sum_of_first_n 4
sum_of_first_n 4
+ 3
[Not supported by viewer]
sum_of_first_n 3
sum_of_first_n 3
+ 2
[Not supported by viewer]
sum_of_first_n 2
sum_of_first_n 2
+ 1
[Not supported by viewer]
sum_of_first_n 1
sum_of_first_n 1
Ø
[Not supported by viewer]
sum_of_first_n 0
sum_of_first_n 0
-------------------------------------------------------------------------------- /lectures/lec12_side_effects/heap.svg: -------------------------------------------------------------------------------- 1 | 2 |
[1;2;3]
[Not supported by viewer]
[1;2;3]
[Not supported by viewer]
l1
[Not supported by viewer]
l2
[Not supported by viewer]
l3
[Not supported by viewer]
r1
[Not supported by viewer]
r2
[Not supported by viewer]
r3
[Not supported by viewer]
-------------------------------------------------------------------------------- /lectures/lec07_higher_order_programming/images/fold_right.svg: -------------------------------------------------------------------------------- 1 | 2 |
f
f
1
1
f
f
2
2
f
f
3
3
f
f
4
4
5
5
f
[Not supported by viewer]
z
z
-------------------------------------------------------------------------------- /lectures/lec07_higher_order_programming/images/sum_fold.svg: -------------------------------------------------------------------------------- 1 | 2 |
+
[Not supported by viewer]
5
5
+
[Not supported by viewer]
4
4
+
[Not supported by viewer]
3
3
+
[Not supported by viewer]
2
2
1
1
+
[Not supported by viewer]
0
[Not supported by viewer]
-------------------------------------------------------------------------------- /lectures/lec07_higher_order_programming/images/list_shape.svg: -------------------------------------------------------------------------------- 1 | 2 |
::
[Not supported by viewer]
1
1
::
[Not supported by viewer]
2
2
::
[Not supported by viewer]
3
3
::
[Not supported by viewer]
4
4
5
5
::
[Not supported by viewer]
[ ]
[Not supported by viewer]
-------------------------------------------------------------------------------- /lectures/lec04_functions/images/stack2.svg: -------------------------------------------------------------------------------- 1 | 2 |
+ 5
[Not supported by viewer]
sum_of_first_n 5
sum_of_first_n 5
+ 4
[Not supported by viewer]
sum_of_first_n 4
sum_of_first_n 4
+ 3
[Not supported by viewer]
sum_of_first_n 3
sum_of_first_n 3
+ 2
[Not supported by viewer]
sum_of_first_n 2
sum_of_first_n 2
+ 1
[Not supported by viewer]
sum_of_first_n 1
sum_of_first_n 1
Ø
[Not supported by viewer]
sum_of_first_n 0
sum_of_first_n 0
0
0
1
1
3
3
6
6
10
10
15
15
--------------------------------------------------------------------------------