Skip to content

Instantly share code, notes, and snippets.

View andy-morris's full-sized avatar

andy morris andy-morris

View GitHub Profile
module HSubst
%default total
infixr 0 >>>
data Ty = O | (>>>) Ty Ty
%name Ty a, b, c
namespace Ctx
data Ctx = Nil | (::) Ty Ctx
@andy-morris
andy-morris / code.rs
Last active October 11, 2016 10:29 — forked from duckinator/code.rs
#[derive(Clone, Copy)]
struct Op(fn(u16, u16));
// lets you call foo() instead of foo.0() (where foo: Op)
impl std::ops::Deref for Op {
type Target = fn(u16, u16);
fn deref(&self) -> &fn(u16, u16) { &self.0 }
}
fn op_mov(one: u16, two: u16) {