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
build-depends: MonadRandom | |
, array | |
, base | |
, megaparsec | |
, mtl | |
, random | |
, shelly | |
, text >= 1.2.2.1 | |
, hsc |
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
takeTree :: Int -> Tree m v -> Tree m v | |
takeTree 0 (Tree v _) = Tree v [] | |
takeTree _ (Tree v []) = Tree v [] | |
takeTree n (Tree v ch) = | |
Tree v (map (foo (n - 1)) ch) | |
where | |
foo n (m, t) = (m, takeTree n t) |
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
(defun sbrg:haskell-run-main (a) | |
(interactive "P") | |
(save-excursion | |
(haskell-interactive-mode-run-expr "main") | |
) | |
) |
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
module Day1 where | |
import Control.Arrow | |
import Data.List | |
import Data.Char | |
import Data.Function | |
import Data.Ord | |
import Util | |
readInput = readFile "inputs/input1" |
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
(setq-local sbrg:pairs | |
'(("(" . ")") | |
("[" . "]") | |
("{" . "}") | |
("\"") | |
("\'") | |
)) | |
(dolist (pair sbrg:pairs) | |
(let* ((lhs (car pair)) (rhs (cdr pair)) fn) |
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
foo(X, Y, S) :- | |
between(0, S, X), | |
between(0, S, Y), | |
S is X + Y, | |
C is Y * 2, | |
C == X. |
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
foo(X, Y, S) :- | |
between(0, S, X), | |
between(0, S, Y), | |
S is X + Y, | |
C is Y * 2, | |
C == X. |
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
\begin{align*} | |
p(b = 0 | y' = m) = \\ | |
p(b = 0 | y' \neq m) = \\ | |
p(b = 1 | y' = m) = \\ | |
p(b = 1 | y' \neq m) = \\ | |
\end{align*} |
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
#!/usr/bin/env bash | |
set -euo pipefail | |
for file in ExamplePrograms/*; do | |
printf "Testing %s.." "$file"; | |
./compiler < "$file" > foo.s; | |
gcc -m32 foo.s; | |
./a.out; | |
echo "=="; |
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
;; Liek this | |
<this_is_a_long_nick> foo | |
<short_nick> bar | |
;; Instead of this | |
<this_is_a_long_nick> foo | |
<short_nick> bar |