Programming with Dependent Types
- Haskell Platform
- cabal update
- cabal install Agda
- agda-mode setup
Getting the libraries
- git clone https://github.com/UlfNorell/agda-prelude
- git clone https://github.com/UlfNorell/agda-summer-school
- cd agda-prelude/agda-ffi
- cabal install
Set up Emacs paths
- M-x agda2-mode
- M-x customize-group agda2
- Add the absolute path to agda-prelude/src to Include Dirs (do not remove "." from the list)
Check that it works
- Open agda-summer-school/exercises/Lambda.agda in Emacs
C-c C-lto type check
C-c C-x C-cto compile
- You should now have an executable Lambda in exercises/
./Lambda example.lam. This should print a desugared lambda term and the result of running it through the SECD machine.
- Agda Wiki
- Mailing list
- IRC channel #agda on freenode
doc/AgdaCheatSheet.agdacontains a number of small examples showing some of the features of Agda.
doc/EmacsCheatSheet.htmllists the most commonly used Emacs mode commands.
- Browse the library. Use
middle mouseto jump to the definitions of library functions.
exercises/SECD/StackSafe.agdaand add types to ensure stack safety.
- Copy your stack safe SECD machine to
exercises/SECD/TypeSafe.agdaand add type safety (running well-typed terms).
- Change the compiler in
exercises/SECD/Compiled.agdato compile well-typed terms and adapt your type safe SECD machine to run the compiled terms.
- Bonus (hard): Track semantics in the types. In the end you should have a run function that is guaranteed to compute a value corresponding to
eval tfor an input term
- Add more features to the lambda calculus (natrec, booleans, ...).
- Invent your own exercises.