Skip to content

Instantly share code, notes, and snippets.

@AndyShiue
AndyShiue / lib.rs
Created January 7, 2016 08:25
implementation of the untyped lambda calculus in Rust and simple tests for it.
use std::collections::HashSet;
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
pub struct Var(String);
#[derive(Clone, Debug, PartialEq, Eq)]
pub enum Term {
Var(Var),
Lam(Var, Box<Term>),
App(Box<Term>, Box<Term>),
open import Data.String
open import Data.List
open import Data.List.Any
data Term : Set where
var : String -> Term
lam : String -> Term -> Term
app : Term -> Term -> Term
sub : Term -> List Term
@AndyShiue
AndyShiue / openpgp.txt
Created December 1, 2017 23:39
OpenKeychain Linked Identity
This Gist confirms the Linked Identity in my OpenPGP key, and links it to this GitHub account.
Token for proof:
[Verifying my OpenPGP key: openpgp4fpr:dfac72e8959f47925e93abd8655fbccf6553cbff]
@AndyShiue
AndyShiue / openpgp.txt
Created December 1, 2017 23:39
OpenKeychain Linked Identity
This Gist confirms the Linked Identity in my OpenPGP key, and links it to this GitHub account.
Token for proof:
[Verifying my OpenPGP key: openpgp4fpr:dfac72e8959f47925e93abd8655fbccf6553cbff]
@AndyShiue
AndyShiue / CuTT.md
Last active October 30, 2024 20:12
Cubical type theory for dummies

I think I’ve figured out most parts of the cubical type theory papers; I’m going to take a shot to explain it informally in the format of Q&As. I prefer using syntax or terminologies that fit better rather than the more standard ones.

Q: What is cubical type theory?

A: It’s a type theory giving homotopy type theory its computational meaning.

Q: What is homotopy type theory then?

A: It’s traditional type theory (which refers to Martin-Löf type theory in this Q&A) augmented with higher inductive types and the univalence axiom.

@AndyShiue
AndyShiue / SetOmega.agda
Created November 9, 2023 15:34
Demonstrate Setω+n
open import Agda.Primitive using (Setω)
test : Setω₂
test = Setω₁
@AndyShiue
AndyShiue / trait_where.rs
Created November 9, 2023 15:40
where-clause after trait declaration
use std::fmt::Display;
trait A<T> where T : Display {}
fn main() {
println!("Hello, world!");
}
@AndyShiue
AndyShiue / overlapping.rs
Created November 9, 2023 15:48
overlapping instances in Rust
trait Foo {}
trait Bar {}
trait Demo<T> {
fn t(_: T) -> T;
}
struct Test;
@AndyShiue
AndyShiue / oneplusone.agda
Last active December 12, 2023 15:31
1 + 1 == 2
data Nat : Set where
zero : Nat
succ : Nat -> Nat
{-# BUILTIN NATURAL Nat #-}
infix 30 _+_
_+_ : Nat -> Nat -> Nat
0 + n = n
succ m + n = succ (m + n)