In this lecture we do a quick recap of Haskell and talk about things like referential transparency, laziness, type classes, and a first simple example of a domain specific embedded language: Signal.)
Signal | [code] |
In this lecture we develop domain specific embedded languages for describing signals and shapes. We talk about the distinction between a deep and a shallow embedding, about compositionality and abstraction.
Matrix | [code] | |
Signal | [code] | |
Signal.Shallow | [code] | |
Signal.Deep | [code] | |
Signal.Example | [code] | |
Shape | [code] | |
Shape.Shallow | [code] | |
Shape.Deep | [code] | |
ANSI | [code] | |
Render | [code] | |
Animate | [code] | |
Example | [code] |
This lecture introduces monads by looking at how to design a simple library for input/output.
Program.Shallow | [code] | |
Program.Deep1 | [code] | |
Program.Deep2 | [code] | |
Program | [code] | |
Game | [code] | |
Coord | [code] | |
Snake | [code] |
In this lecture we look at another application of monads, namely parsing. We also see how to refine the implementation of a library. Starting from a naive translation from syntax to semantics, we derive intermediate representations for an efficient implementation. The focus here is on learning outcome "Spec: use specifictaion based development techniques".
ParseUtil | [code] | |
Parsers | [code] | |
Parser0 | [code] | |
Parser1 | [code] | |
Parser2 | [code] | |
Parser3 | [code] | |
exe/Example | [code] |
We learn how to build complicated monads from simple building blocks.
MonadT_API_summary | [code] | |
Interpreter0 | [code] | |
Interpreter1 | [code] | |
Interpreter2 | [code] | |
Interpreter3 | [code] | |
Interpreter4 | [code] | |
Examples | [code] | |
Parser | [code] |
We look at program verification: proving, specifying and testing correctness of programs.
InsertionSort | [code] |
We look at two recent extensions to Haskell: GADTs and Type families.
Expr | [code] | |
Typed | [code] | |
Parser | [code] | |
Add | [code] | |
Array | [code] | |
Array/Properties | [code] | |
Array/Example | [code] | |
Array/ShowInstances | [code] | |
Array/EqInstances | [code] |
In this lecture / excerices session we will work through old AFP exam questions in groups to identify important topics and practice collaborative problem solving and discussion. This is in response to student comments from last year wanting more practice of the kind of problems typically included in the written exams.
Feldspar is an embedded language for high-performance numeric processing. Its development is motivated by the need to raise the abstraction level of signal processing code in Ericsson's radio base station. In this lecture I will present Feldspar with a special focus on its implementation in Haskell.
In this lecture we continue the work on QuickCheck, mainly looking at how to generate and shrink test data. We may also look at the different stackings of the monad transformers in the Interpreter4 example (from the MonadTransformes lecture). We also check out how the program coverage tool hpc can be used to see what parts of a program has been tested.
ParserTests | [code] |
In dependently typed languages such as Agda one can both write programs and proofs about the programs. Agda can be seen as a "next generation Haskell".
In dependently typed languages such as Agda one can both write programs and prove propositions which refer to the programs. Building on Patrik's introduction to Agda I will implement a very simple theorem prover, and formally prove that it is sound.
Prelude | [code] | |
Proof-by-reflection | [code] |
Lazy SmallCheck is a testing tool for Haskell which is based on exhaustive enumeration of test cases (instead of random test case generation). It uses lazy narrowing, a search mechanism suitable for functional programming languages which exploits non-strictness. In the lecture I will present lazy narrowing, how the tool is implemented as a library using type reflection and exception trapping, and how to use the tool for testing (contrasting it to QuickCheck).
In this lecture we look back at the learning outcomes and how they relate to the different parts of the course and what parts of the RWH book are covered. Some other relevant topics did not fit but I include references and code below.
RWMonad | [code] | |
MaybeT/Deep | [code] | |
MaybeT/Shallow | [code] |
FFI | [code] | |
foreign.c | ||
Cont | [code] | |
Memo | [code] | |
Generics | [code] | |
NoGenerics | [code] |