int add(int x, int y)
{
return x + y;
}
int main()
{
assert_eq(3, add(1, 2));
}
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ (apply (run "vlc") (filter (make-file-pred :modified :since :yesterday) | |
(run "ls"))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> 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)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
machine github.com | |
login milesrout | |
password SECRETACCESSTOKEN | |
protocol https |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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>, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function dbConnect($type, $SQLdata) { | |
$sqlPassData = array('error' => true); | |
if($type == 'query') { | |
$sqlPassData = array( 'user' => $SQLdata['queryUsername'], | |
'pwd' => $SQLdata['queryPassword']); | |
} elseif ($type == 'admin') { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |