Built with
Alectryon , running Coq+SerAPI. Bubbles (
) indicate interactive fragments: hover for details, tap to reveal contents. Use
Ctrl+↑ Ctrl+↓ to navigate,
Ctrl+🖱️ to focus. On Mac, use
⌘ instead of
Ctrl .
Syntax highlighting
To compile:
alectryon syntax_highlighting.v
# Coq → HTML; produces ‘syntax_highlighting.html’
Definition a : nat :=
let '(x, y) := (1 , 2 ) in
let ' (z, t) := (x, y) in
let 'tt := tt in
let fix f (x : nat) {struct x } : nat := x in
(fun ' (f, x, y) => f (x + y)) (f, t, y).
Print a.a =
let
'(x, y) := (1 , 2 ) in
let
'(_, t) := (x, y) in
let
'tt := tt in
let fix f (x0 : nat) : nat := x0 in
(fun '(f0, x0, y1) => f0 (x0 + y1)) (f, t, y)
: nat
Definition test (as' is' with' : nat) :=
match match 1 with
| S is' => 0
| 0 => 1
end with
| S with' => None
| 0 => Some 1
end .
Print test.test =
fun _ _ _ : nat =>
match match 1 with
| 0 => 1
| S _ => 0
end with
| 0 => Some 1
| S _ => None
end
: nat -> nat -> nat -> option nat
Arguments test (_ _ _)%nat_scope
Notation "$0" := (0 , 0 ).
Infix "$+" := (fun '(u, a) '(_, b) => (u, a + b)) (at level 39 ).
Definition b := fun '(x, y) '(pair x' y') => (x + x', y + y').
Print b.b =
fun '(x, y) '(x', y') => (x + x', y + y')
: nat * nat -> nat * nat -> nat * nat
Notation "` x '' y `" := (x + y).
Check (1 + 2 ).