Skip to content

Instantly share code, notes, and snippets.

@zanzix
zanzix / ContKind.idr
Last active August 22, 2024 11:23
Continuations and opposite kinds
namespace OpKind
data Kind : Type where
Set : Kind -- Set
Op : Kind -> Kind -- Set^op
data Ty : Kind -> Type where
NAT : Ty k
Zero : Ty k
Add : Ty k -> Ty k -> Ty k
One : Ty k
@zanzix
zanzix / Polymorphism.idr
Last active February 26, 2025 23:05
Substructural Polymorphism
import Data.Relevant.Cover as Rel
import Data.Linear.Cover as Lin
import Data.Vect
Ctx : Type
Ctx = List String
export infixr 5 ~>
data Ty : (typeVars : Ctx) -> Type where
@zanzix
zanzix / 1_Ty.idr
Last active March 14, 2025 10:43
Polarised System L
module Ty
public export
data Kind : Type where
Set : Kind
Op : Kind
public export
data Dual : Kind -> Kind -> Type where
L : Dual Set Op