Skip to content

Instantly share code, notes, and snippets.

View evanrinehart's full-sized avatar

Evan Rinehart evanrinehart

View GitHub Profile
@evanrinehart
evanrinehart / I.hs
Last active March 21, 2018 23:41
What something is is what you can do with it
{-# LANGUAGE GADTs #-}
{-# LANGUAGE RankNTypes #-}
module I where
-- reals in the interval [0,1]
-- If you have some I, and you give me any average algebra a
-- then I will give you a view of I as a sequence of a-valued approximations
data I where
MkI :: (forall a . AvgAlgebra a => [a]) -> I
module Main where
import SDL
import SDLEntry
import qualified Data.Vector.Unboxed as VU
import System.Exit
import Data.IORef
main = do
worldVar <- newIORef 0
module Main where
import Network
import Control.Monad (forever)
import Data.Function (fix)
import Control.Exception (try)
import System.IO
import Data.IORef
import Control.Concurrent (forkIO)
λ> wget https://moneroaddress.org/
index.html 100%[================>] 810.34K 510KB/s in 1.6s
λ> wget https://raw.githubusercontent.com/moneromooo-monero/monero-wallet-generator/master/monero-wallet-generator.html.asc
monero-wallet-gene 100%[================>] 819 --.-KB/s in 0s
λ> mv index.html monero-wallet-generator.html
λ> gpg --verify monero-wallet-generator.html.asc
gpg: assuming signed data in `monero-wallet-generator.html'
gpg: Signature made Sat Feb 4 04:02:33 2017 CST using RSA key ID 4D6CEFC3
gpg: BAD signature from "moneromooo-monero <[email protected]>"
λ> gpg --verify monero-wallet-generator.html.asc
gpg: no signed data
gpg: can't hash datafile: file open error
digraph G {
center=true;
size="7.5,10";
nodesep=1;
idle [shape=circle, height=1, rank=source];
effect1 [shape=circle, height=1];
effect2 [shape=circle, height=1];
effect3 [shape=circle, height=1, rank=sink];
module ReductionMachine where
-- Abstract lazy functional pure assembly language
-- Programs (libraries containing a "main") in this language could
-- in principle be assembled on to run directly on the computer.
-- a full program is a pile of named Funcs, one of them "main"
type Lib = [(CodeName, Func)]
type Func = ([VarName], Body)
data E = S | K | App E E
-- big step reduction, eager, may not terminate
reduce :: E -> E
reduce (App (App K x) y) = reduce x
reduce (App (App (App S x) y) z) =
let a = reduce x in
let b = reduce y in
let c = reduce z in
reduce (App (App a c) (App b c))
diff --git a/HEAD^^:../Bed_Puzzle.ino b/HEAD:./bed-puzzle.ino
index 62ab181..126dd77 100644
--- a/HEAD^^:../Bed_Puzzle.ino
+++ b/HEAD:./bed-puzzle.ino
@@ -29,20 +29,48 @@ void setup() {
Serial.begin(9600);
}
+/* debounced switch HIGH detectors */
+#define DEBOUNCE_TIME 100
{-# LANGUAGE GADTs #-}
{-# LANGUAGE DeriveFunctor #-}
module MLC where
import Foreign.Ptr
-- machine lambda calculus
data E
= Var Integer