Skip to content

Instantly share code, notes, and snippets.

View chryslovelace's full-sized avatar

Chrysanthemum Lovelace chryslovelace

View GitHub Profile
@chryslovelace
chryslovelace / tuesday.c
Last active March 12, 2019 21:17
tuesday
// compile with `gcc -shared -o tuesday.so tuesday.c`
#include <time.h>
int day_of_week()
{
time_t t;
time(&t);
return localtime(&t)->tm_wday;
}
@chryslovelace
chryslovelace / nono.idr
Last active March 15, 2019 14:27
a dependently typed nonogram solver algorithm (wip)
module nono
import Data.Vect
mutual
data Descriptor : Nat -> Type where
Nil : Descriptor n
(::) : (k : Nat) -> (d : Descriptor n) -> Descriptor (k + n + isNotEmpty d)
isNotEmpty : Descriptor n -> Nat
@chryslovelace
chryslovelace / sess.idr
Created May 4, 2018 04:29
Session types in Idris
module sess
import System.Concurrency.Channels
infix 3 :!:, :?:
infix 2 :+:, :&:
data Protocol : Type where
Eps : Protocol
(:!:) : Type -> Protocol -> Protocol