This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Lens | |
-- Concrete get/set lens | |
record Lens s t a b where | |
constructor MkLens | |
get : s -> a | |
set : s -> b -> t | |
unitLens : Lens a b a b | |
unitLens = MkLens id (\x => id) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Main | |
data Vect : Type -> Nat -> Type where | |
Nil : Vect a Z | |
(::) : (x: a) -> (xs : Vect a n) -> Vect a (S n) | |
data Tree : Type -> Nat -> Type where | |
Empty : Tree a Z | |
Leaf : a -> Tree a (S Z) | |
Node : Tree a k1 -> Tree a k2 -> Tree a (S (plus k1 k2)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module HVect | |
import Data.Vect | |
-- Heterogeneous vector | |
public export | |
data HVect : Vect n Type -> Type where | |
Nil : HVect Nil | |
(::) : h -> HVect t -> HVect (h :: t) | |
export |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\[ | |
\begin{tikzcd} | |
&C | |
\arrow[ld, "\pi_X"'] | |
\arrow[rd, "\pi_Y"] | |
\\ | |
P \langle X X \rangle | |
\arrow[dr, "{P \langle id, f \rangle}"'] | |
&&P \langle Y, Y \rangle | |
\arrow[dl, "{P \langle f, id \rangle}"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\begin{tikzpicture} | |
\def \xrightmost {2} | |
\def \xright {1} | |
\def \xmid {0} | |
\def \xleft {-\xright} | |
\def \xleftmost {-\xrightmost} | |
\def \ybot {0} | |
\def \ymid {1} |