Skip to content

Instantly share code, notes, and snippets.

View fionafibration's full-sized avatar

Fiona fionafibration

View GitHub Profile
@mstewartgallus
mstewartgallus / Main.java
Created September 5, 2020 00:31
Tagless final style in pure Java using curiously recurring template types.
package com.sstewartgallus;
import java.util.function.Function;
public class Main {
public static void main(String[] args) {
var result = program(new EvalLambdaFactory());
var source = program(new PrettifyLambdaFactory());
System.out.println("Source " + source);
System.out.println("Result " + result);
@mniip
mniip / cd.v
Last active November 12, 2020 17:09
Inductive opt {A : Type} : bool -> Type :=
| Nothing : opt false
| Just : A -> opt true.
Arguments opt : clear implicits.
Definition mkOpt {A : Type} {b : bool} (x : A) : opt A b :=
if b return opt A b then Just x else Nothing.
Definition mapOpt {A B : Type} {b : bool} (h : A -> B) (o : opt A b) : opt B b :=
match o with
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@23Skidoo
23Skidoo / Crawl.hs
Created October 22, 2012 11:14
Don Stewart's 2004 Obfuscated Haskell Contest entry updated to work with GHC 7.4.2
{-# LANGUAGE MagicHash #-}
module Main where
import GHC.Base
main = let l =
[106,117,115,116,32,97,32,115,105,109,112,108,101,
32,102,117,110,99,116,105,111,110,97,108,32,108,
97,110,103,117,97,103,101,0x11] :: [Int]
in
#!/usr/bin/python
import sys
import datetime
# Calculates death probabilities based on Social Security
# actuarial tables for a given group of people.
# Run with a list of ages/genders and an optional timespan (or year in the future):
# python actuary.py 63m 80m 75f 73m 10