Skip to content

Instantly share code, notes, and snippets.

View bitmappergit's full-sized avatar

Bram Wyllie bitmappergit

View GitHub Profile
from colin on the programming languages discord:
(in regards to TaPL)
got a signed copy in my office
I said "Dr Pierce, could you please sign my book?"
and he looked repulsed and said
"I think you mean my book, you little sweat, bring it over, fatty"
I was like "but I'm holding it in front of you"
and he was like "sure thing kid, tell your story walking"
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE BlockArguments #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE OverloadedLabels #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE FunctionalDependencies #-}
{-# LANGUAGE AllowAmbiguousTypes #-}
{-# LANGUAGE TypeApplications #-}
(eval-when (:compile-toplevel
:load-toplevel)
(require :asdf)
(require :alexandria))
(defpackage risc5-asm
(:use common-lisp)
(:import-from alexandria format-symbol))
(in-package :risc5-asm)
#[derive(Clone, Debug)]
enum Term
{ Abs(Box<Term>)
, App(Box<Term>, Box<Term>)
, Var(usize)
}
fn eval(t: Term, env: &mut Vec<Term>) -> Term
{ match t
{ Term::Abs(val) => Term::Abs(val)
from copy import deepcopy
import operator
from pprint import pprint
from fractions import Fraction
class Matrix:
def __init__(self, width, height):
self.width = width
self.height = height
self.size = max(width, height)
@bitmappergit
bitmappergit / Huggable.hs
Created November 9, 2021 19:02
huggable optics
module Huggable where
swap :: (a, b) -> (b, a)
swap (a, b) = (b, a)
newtype Star f a b = Star { runStar :: a -> f b }
newtype Forget r a b = Forget { runForget :: a -> r }
class Profunctor p where
dimap :: (a -> b) -> (c -> d) -> p b c -> p a d
use std::convert::TryInto;
use std::io::{BufRead, Read, Write};
use std::process::exit;
const IMAGE_SIZE: usize = 242000;
const NUM_DEVICES: usize = 2;
const TIB: usize = 1471;
type Cell = i32;
common lisp
zetalisp
scheme
standard ml
lean
ocaml
haskell
idris
myrddin
coq
{-# LANGUAGE RankNTypes
, BlockArguments
, GADTs
, MultiParamTypeClasses
, OverloadedLabels
, DataKinds
, PolyKinds
, FunctionalDependencies
, AllowAmbiguousTypes
, TypeApplications
@bitmappergit
bitmappergit / ski.c
Last active September 30, 2021 16:07
#include <stdio.h>
#include <stdbool.h>
#include <stdlib.h>
#include <gc.h>
typedef enum {
APP,
CON,
COMB,
} tag_t;