- VSCode or IntelliJ?
- Literals
- Expressions have types and produce values
- Compound expressions
- All values are objects
- Method call syntax
- dot notation
- parameters
- Starting and stopping
sbt
- Wrapping code in
object
- Compiling code
- Running code and using
App
- Experimenting in the console
sbt
Workflow- TODO Decide on workflow. Are we going with Visual Studio Code or IntelliJ? How do we recommend running code (using
run
orconsole
)?
- Giving names to values
- Motivation
- Using names
- Names abstract over expressions
- The substitution model of evaluation
- Order of evaluation
- Local reasoning
- TODO Consider breaking this up into smaller sections. It’s hard to understand the theory without getting some experience, and beginners probably want to get coding before they get a big dose of theory.
- Doodle basics
- Motivation
- Method declaration syntax
- Method call semantics
- In terms of substitution
- Methods generalize expressions
- Motivation
- Do something a variable number of times
- The natural numbers
- Recursive definition
- Structural recursion pattern
- Structure of code follows structure of definition
- Solve the cases
- Reasoning about code
- Operational reasoning: substitution
- Denotational reasoning: what is the base case, what is the one-step recursive case?
- Fractals
- Functions as values
- Abstracting over expressions with functions
- Parametric equations of curves
- Function composition
- Composition for parametric equations
- Animations as images displayed over time instead of space
- Animation using reactors (or transducers?)
- Structural recursion “unrolled” into a reactor
- Parametric equations as reactors
- Paths as lists of path elements
- Local coordinate systems; bounding box and origin
- Polygons as paths
- Structural recursion over lists
- `map` for transforming lists
- Case classes as logical ands
- Animations using custom data
- Simple physics. Bouncing ball.
- Changing length of a list to add and remove particles in a particle system
- flatMap using structural recursion
- flatMap as changing the length of a List
- Responding to mouse events
- Particle systems. Ripples. etc.
- Tile matching video game
- Modelling data in terms of ands and ors; sealed traits and final case classes
- Non-recursive data
- NOTE Keep examples concrete
- Structural recursion (w/o recursion!)
- Pattern matching (familiar by now)
- Polymorphism
- Abstract methods
- State machines. FSM animations. E.g. exploding fireworks Or interacting FSMs? FSMs for modelling interaction?
- The recursion rule
- Recursive data
- Transforming recursive data
- Grammars and l-systems
- Generic types
- Containers
- Functions to work with generic types
- kd-tree? Faster intersection tests?
- Option, Either, Map
- map, flatMap
- find, exists
- We’ve already seen map, but review
- flatMap
- L-Systems again?
- fold as an abstraction of structural recursion
- Implicit parameters
- Implicit values
- Monoid
- Monad
- Applicative / Semigroupal
- Generative art w/ randomisation