This is a tutorial on how Agda infers things.
There are two ways to read the tutorial:
- click this link to read the rendered HTML. Simple and sufficient, if you only want to read and not play with the code or contribute
- if you do want to play with the code, then install Agda, clone the repo, open the
InferenceInAgda.lagda.mdfile, type check it and only then read
IMPORTANT: reading InferenceInAgda.lagda.md without type checking the file beforehand is a non-option as making Agda color the code is important for understanding how things get type checked. Hence reading InferenceInAgda.lagda.md directly on GitHub is a non-option as well as GitHub's syntax highlighting is insufficient and the file has to actually be type checked.
Building the HTML is a bit of a PITA as it requires several tools to be installed and several commands to be executed. So if you're going to create a PR, don't bother updating the HTML file, I'll do that myself.
- install
agdaand its standard library - install
htmlizeforemacs. For example via(use-package htmlize :ensure t) - install
agda-html-to-md - install
pandoc - add this to your
.emacs.dfile:
(global-set-key (kbd "C-x a h") 'htmlize-buffer)
(fset 'generate-inference-in-agda-html
[?\C-x ?h ?\C-u ?\M-| ?a ?g ?d ?a ?- ?h ?t ?m ?l ?- ?t ?o ?- ?m ?d return ?\C-x ?h ?\M-| ?p ?a ?n ?d ?o ?c ? ?- ?- ?t ?o ?c ? ?- ?s ? ?- ?o ? ?I ?n ?f ?e ?r ?e ?n ?c ?e ?I ?n ?A ?g ?d ?a ?. ?h ?t ?m ?l return])
(global-set-key (kbd "C-x a i") 'generate-inference-in-agda-html)IMPORTANT: wait for each command to finish.
- open
InferenceInAgda.lagda.mdin emacs C-c C-l(type check the file)C-x a h(initial htmlization of the buffer)C-x a i(generate the finalInferenceInAgda.htmlfile)