Skip to content

Instantly share code, notes, and snippets.

View milesrout's full-sized avatar

Miles Rout milesrout

View GitHub Profile
I can't use MonadFailDesugaring because it's only supported in GHC 8.0, and GHC 8.0.1
has a major bug in its pattern synonym support: it panics on nested synonyms when
loaded into GHCI.
$ (apply (run "vlc") (filter (make-file-pred :modified :since :yesterday)
(run "ls")))
Given a type T:
T? an optional T (c.f. Maybe, Either T ())
T* a sequence of Ts (c.f. [T])
T+ a non-empty sequence of Ts (c.f. (T,[T]), NonEmpty T)
T{N} exactly N Ts
Given types T and U:
T,U the product type of T and U (c.f. (T,U))
>>> for_ (map (show . wlemN) [2..4]) putStrLn
(¬(P1 ∧ P2) → (¬P1 ∨ ¬P2))
(¬(((P1 ∧ P2) ∨ (P1 ∧ P3)) ∨ (P2 ∧ P3)) → ((¬P1 ∨ ¬P2) ∨ ¬P3))
(¬((((((P1 ∧ P2) ∨ (P1 ∧ P3)) ∨ (P1 ∧ P4)) ∨ (P2 ∧ P3)) ∨ (P2 ∧ P4)) ∨ (P3 ∧ P4)) → (((¬P1 ∨ ¬P2) ∨ ¬P3) ∨ ¬P4))
machine github.com
login milesrout
password SECRETACCESSTOKEN
protocol https
dgp :: Formula -> Formula -> Formula
dgp p q = (p #> q) #| (q #> p)
pp :: Formula -> Formula -> Formula
pp p q = ((p #> q) #> p) #> p
p = Proposition "P"
q = Proposition "Q"
r = (dgp p q) #> p
s = pp (dgp p q) p
@milesrout
milesrout / memes
Last active July 5, 2016 12:13
let the memes commence
miles@laptop:~/Projects/monad_io $ g++ monad_io.cpp -std=c++1y
miles@laptop:~/Projects/monad_io $ ./a.out | c++filt
builtin_cons<
builtin_char<(char)72>,
builtin_cons<
builtin_char<(char)101>,
builtin_cons<
builtin_char<(char)108>,
builtin_cons<
builtin_char<(char)108>,
@milesrout
milesrout / functions.php
Created June 27, 2016 09:54
DON'T USE THIS I WROTE IT WHEN I WAS A CHILD AND AM STILL EMBARRASSED BUT IT'S MOSTLY PHP'S FAULT FOR BEING AWFUL
<?php
function dbConnect($type, $SQLdata) {
$sqlPassData = array('error' => true);
if($type == 'query') {
$sqlPassData = array( 'user' => $SQLdata['queryUsername'],
'pwd' => $SQLdata['queryPassword']);
} elseif ($type == 'admin') {
@milesrout
milesrout / 1.basic.md
Last active June 12, 2016 11:53
Chalice Examples
int add(int x, int y)
{
        return x + y;
}

int main()
{
        assert_eq(3, add(1, 2));
}
T E R R I B L E
R E T A R D S
I M P L E M E N T I N G
L O W
L E V E L
E N G I N E
K R A P
T R I L L E K
R E T A R D S