Skip to content

Instantly share code, notes, and snippets.

@erdeszt
erdeszt / etest.h
Created February 8, 2020 16:02
Single header C test framework
#ifndef _E_TEST_H_
#define _E_TEST_H_
#include <stdint.h>
#include <stdio.h>
#define TEST(suite, name) \
if (_etest_is_test_included_in_run(#suite, #name, test_context)) { \
_etest_register_running_test(#suite, #name, test_context); \
} \
@erdeszt
erdeszt / GDP.scala
Last active April 15, 2019 09:02
Ghosts of departed proofs in scala (https://github.com/matt-noonan/gdp-paper/releases)
trait Coercible[A, B] {
def coerce(a: A): B
}
def coerce[A, B](a: A)(implicit coerceAB: Coercible[A, B]): B = {
coerceAB.coerce(a)
}
trait Newtype[+T] {
val value: T
@erdeszt
erdeszt / IndexedResourceT.hs
Last active May 10, 2018 20:11
Indexed ResourceT monad (repl.it link: https://repl.it/repls/EsteemedDeficientArea)
{-# LANGUAGE KindSignatures
, PolyKinds
, DataKinds
, TypeFamilies
, TypeOperators
, GADTs
#-}
module IxResourceT where