This file contains hidden or 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
(() => { | |
if (__relayXSpy) { | |
__relayXSpy.disconnect(); | |
} | |
var __relayXSpy = new MutationObserver(records => { | |
records.forEach(({ addedNodes, removedNodes }) => { | |
for (const added of addedNodes) { | |
console.log('added', printNode(added)); | |
} |
This file contains hidden or 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
{ | |
"$schema": "https://vega.github.io/schema/vega/v4.json", | |
"width": 300, | |
"height": 240, | |
"padding": 5, | |
"config": { | |
"axis": { | |
"labelLimit": 500 | |
} |
This file contains hidden or 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
{ | |
"$schema": "https://vega.github.io/schema/vega/v4.json", | |
"width": 700, | |
"height": 100, | |
"padding": {"left": 5, "right": 5, "top": 0, "bottom": 20}, | |
"autosize": "none", | |
"signals": [ | |
{ "name": "cx", "update": "width / 2" }, | |
{ "name": "cy", "update": "height / 2" }, |
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Elea Crockett Portfolio</title> | |
<meta http-equiv="refresh" content="0; url=https://eleacrockett.github.io/portfolio/" /> | |
</head> | |
<body> | |
</body> | |
</html> |
This file contains hidden or 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
type StackOps<S, A> = { | |
init(): S | |
push(s: S, x: A): void | |
pop(s: S): A | |
size(s: S): number | |
} | |
type Stack<A> = <R>(go: <S>(ops: StackOps<S, A>) => R) => R | |
const arrayStack = <A>(): Stack<A> => |
This file contains hidden or 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
const λ = ({raw}, ...subs) => { | |
const expr = raw | |
.reduce((prev, next, n) => prev + `(___subs[${n - 1}])` + next) | |
.replace(/#(\d+)/g, (_, n) => `(___args[${n}])`) | |
const evaluate = new Function('___subs', '___args', `return (${expr});`) | |
return (...args) => evaluate(subs, args) | |
} |
This file contains hidden or 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
curry : {A : Type} | |
-> {B : A -> Type} | |
-> {C : Sigma A B -> Type} | |
-> ((p : Sigma A B) -> C p) | |
-> (x : A) -> (y : B x) -> C (x ** y) | |
curry f x y = f (x ** y) | |
-- Dependent uncurry is just the induction principle for sigma types | |
uncurry : {A : Type} | |
-> {B : A -> Type} |
This file contains hidden or 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
BinOp : (A : Type) -> Type | |
BinOp A = A -> A -> A | |
parameters ((*) : BinOp a) | |
IsAssociative : Type | |
IsAssociative = (x, y, z : _) -> x * (y * z) = (x * y) * z | |
IsLeftIdentity : a -> Type | |
IsLeftIdentity e = (x : _) -> e * x = x |
This file contains hidden or 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
-- Axioms | |
rec_N : | |
(P : Nat -> Type) -> | |
(ind : (n : Nat) -> P n -> P (S n)) -> | |
(base : P Z) -> | |
(m : Nat) -> | |
P m | |
Even : (n : Nat) -> Type | |
Odd : (n : Nat) -> Type | |
zeroIsEven : Even Z |
This file contains hidden or 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
-- Informal proof: | |
--============================================================== | |
-- S a * (b + c) | |
--= b + c + a * (b + c) -- definition of * | |
--= b + c + (a * b) + (a * c) -- induction hypothesis | |
--= b + (a * b) + c + (a * c) -- associativity / commutativity | |
--= S a * b + S a * c -- definition of * | |
-- With all associativity and commutativity manipulations: | |
--============================================================== |
NewerOlder