I hereby claim:
- I am hallettj on github.
- I am hallettj (https://keybase.io/hallettj) on keybase.
- I have a public key whose fingerprint is A378 B079 9F05 93C0 B499 DD02 8FB4 E35F E86B 913B
To claim this, I am signing this object:
/* @flow */ | |
type Tree<T> = | |
| { type: "Node", value: T, left: Tree<T>, right: Tree<T> } | |
| { type: "EmptyTree" } | |
function find<T>(p: (v: T) => boolean, t: Tree<T>): T | void { | |
var l, v | |
if (t.type === "Node") { |
# Category Theory proofs in Idris | |
Idris is a language with dependent types, and is similar to Agda. | |
What distinguishes Idris is that it is intended to be a general-purpose language first, | |
and a theorem prover second. | |
To that end it supports optional totality checking | |
and features to support writing DSLs: | |
type classes, | |
do notation, | |
monad comprehensions (i.e., a more general form of list comprehension), |
module Logic | |
infixr 1 ==> | |
(==>) : Bool -> Bool -> Bool | |
False ==> _ = True | |
True ==> x = x | |
data Exists : (A : Type) -> (P : A -> Bool) -> Type where | |
exists : {A : Type} -> {P : A -> Bool} -> (a : A) -> so (P a) -> Exists A P |
I hereby claim:
To claim this, I am signing this object:
/* | |
* The implementation | |
*/ | |
function du(comprehension) { | |
return function(/* args */) { | |
var gen = comprehension.apply(null, arguments) | |
return next(); | |
function next(v) { |
# open vim in a new split | |
bind e split-window -h -c "#{pane_current_path}" sensible-editor | |
# shortcuts for common git operations | |
bind g split-window -h -c "#{pane_current_path}" 'GIT_PAGER="less -+F" git lg' | |
bind D split-window -h -c "#{pane_current_path}" 'GIT_PAGER="less -+F" git diff' | |
bind C split-window -h -c "#{pane_current_path}" 'GIT_PAGER="less -+F" git diff --cached' | |
bind A split-window -h -c "#{pane_current_path}" 'git add -p' |
! | |
! Invert number row | |
! | |
! This changes the behavior of keys in the number row, but does not | |
! affect the number pad. | |
! | |
keycode 10 = exclam 1 1 exclam | |
keycode 11 = at 2 2 at | |
keycode 12 = numbersign 3 3 numbersign | |
keycode 13 = dollar 4 4 dollar |
import Control.Applicative ((<$>), (<*>)) | |
import Control.Concurrent.Async (Concurrently(..), runConcurrently) | |
import Data.Monoid (Monoid, (<>), mappend, mempty) | |
instance (Monoid a) => Monoid (IO a) where | |
mappend x y = runConcurrently $ (<>) <$> Concurrently x <*> Concurrently y | |
mempty = return mempty | |
-- example: | |
action = getLine <> getLine |
var fs = require('fs'); | |
var exec = require('child_process').exec; | |
var templ_ = fs.readFileSync('package.json.template', { encoding: 'UTF-8' }); | |
var templ = JSON.parse(templ_); | |
var deps = {}; | |
exec("npm search substack | grep '=substack' | awk '{ print $1 }'", function(err, stdout) { | |
var lines = stdout.toString('UTF-8'); | |
lines.split("\n").forEach(function(line) { |
http://swannodette.github.io/mori/
var l0 = mori.list(3, 4, 5);
var l1 = mori.cons(2, l0);