Skip to content

Instantly share code, notes, and snippets.

View johnchandlerburnham's full-sized avatar
💭
Λ∀

John Chandler Burnham johnchandlerburnham

💭
Λ∀
View GitHub Profile
@johnchandlerburnham
johnchandlerburnham / solarized-dark.css
Created August 20, 2017 01:31 — forked from nicolashery/solarized-dark.css
Solarized theme stylesheets for Jekyll and Pygments
/* Solarized Dark
For use with Jekyll and Pygments
http://ethanschoonover.com/solarized
SOLARIZED HEX ROLE
--------- -------- ------------------------------------------
base03 #002b36 background
base01 #586e75 comments / secondary content
@johnchandlerburnham
johnchandlerburnham / AnnotationProto.hs
Created February 5, 2019 13:59
Some thoughts on how to do type annotations in Michelson
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE ExistentialQuantification #-}
{-# LANGUAGE ExplicitNamespaces #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeApplications #-}
@johnchandlerburnham
johnchandlerburnham / Univalence.fm
Last active October 9, 2019 08:44
Univalence in Formality
// based on https://arxiv.org/pdf/1803.02294.pdf
import Relation.Equality
K : { X : Type} -> Type
{x : X, y : X, p : Path(X,x,y), q : Path(X,x,y)} -> Path(Path(X,x,y),p,q)
J :
{ X : Type
, x : X
@johnchandlerburnham
johnchandlerburnham / funext.fm
Last active October 18, 2019 21:30
Why we want functional Extentionality in formality
// Let's start our lawful Functor abstraction
T Functor {F : Type -> Type}
| functor
{ map : {~A : Type , ~B : Type , f : A -> B, x : F(A)} -> F(B)
, identity : {~A : Type , fa : F(A)} -> map(~A, ~A, id(~A),fa) == fa
, composition :
{ ~A : Type
, ~B : Type
, ~C : Type
@johnchandlerburnham
johnchandlerburnham / HIT.fm
Created October 19, 2019 18:42
more funext
import Data.Empty
import Data.Unit
Interval : Type
$self
{ ~P : {i : Interval} -> Type
, I0 : P(i0)
, I1 : P(i1)
, ~SG : I0 == I1
} -> [x : P(self) ~ I0 == I1]
@johnchandlerburnham
johnchandlerburnham / funext_functor.fm
Created October 20, 2019 16:37
The effect intensionality has on Functors
import Relation.Binary
import Relation.Equality
// identity function
id : {~A : Type, x:A} -> A
x
// composition function
compose : {~A : Type, ~B : Type, ~C : Type, g : B -> C, f : A -> B, x : A} -> C
g(f(x))
import Data.Nat
import Data.InductionTree
Array : {A : Type, n : Nat} -> Type
case/Nat n
| succ => [x : Array(A, n.pred), Array(A, n.pred)]
| zero => A
: Type
// ::::::::::
@johnchandlerburnham
johnchandlerburnham / fm-net-c.wat
Last active November 15, 2019 06:35
fm-net-c.wat
(module
(type (;0;) (func (param i32)))
(type (;1;) (func (result i32)))
(type (;2;) (func (param i32) (result i32)))
(type (;3;) (func (param f64) (result f64)))
(type (;4;) (func (param f64 f64) (result f64)))
(type (;5;) (func (param f64 f64) (result i64)))
(type (;6;) (func (param i32 i32 i32 i32) (result i32)))
(type (;7;) (func (param f64 f64) (result i32)))
(type (;8;) (func (param i32 i32 i32 i32) (result f64)))
@johnchandlerburnham
johnchandlerburnham / STYLE.md
Last active November 19, 2019 22:51
Formality style

A Formality Style Guide

"considering making single-line definitions with ; a syntax error to stop your kingdom of evil" --Victor Maia

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119

@johnchandlerburnham
johnchandlerburnham / wasm-i64-f64.md
Last active December 5, 2019 00:48
wasm i64 and f64 ops

i64, 29 ops

Op Signature
i64.eqz [i64] -> i32
i64.eq [i64,i64] -> i32
i64.ne [i64,i64] -> i32
i64.lt_s [i64,i64] -> i32
i64.lt_u [i64,i64] -> i32
i64.gt_s [i64,i64] -> i32