This file contains 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
c :: String -> ((String -> a) -> a) | |
c str = \k -> k str | |
d :: (String -> a) -> Int -> a | |
d = \k -> (\int -> k (show (int::Int))) | |
s :: (String -> a) -> String -> a | |
s = \k -> (\str -> k (str::String)) | |
printf :: ((String -> IO ()) -> a) -> a |
This file contains 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
{-# LANGUAGE OverloadedStrings #-} | |
module Main where | |
import Control.Monad | |
import Data.Monoid | |
import Data.Text (Text) | |
import qualified Data.Text as T | |
import qualified Data.Text.IO as T | |
import Database.Rivet | |
import Database.Rivet.Adaptor.PostgreSQL |
This file contains 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
dependencies: | |
cache_directories: | |
- "~/.stack" | |
pre: | |
- wget https://github.com/commercialhaskell/stack/releases/download/v0.1.2.0/stack-0.1.2.0-x86_64-linux.gz -O /tmp/stack.gz | |
- gunzip /tmp/stack.gz && chmod +x /tmp/stack | |
- sudo mv /tmp/stack /usr/bin/stack | |
override: | |
- stack setup | |
- stack build |
This file contains 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
;; -*- mode: emacs-lisp -*- ;; | |
(require 'cl) | |
;; set up marmelade for package management | |
(require 'package) | |
(add-to-list 'package-archives | |
'("melpa" . "http://melpa.milkbox.net/packages/") t) |
This file contains 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
### Keybase proof | |
I hereby claim: | |
* I am dbp on github. | |
* I am dbp (https://keybase.io/dbp) on keybase. | |
* I have a public key whose fingerprint is 36EE AD9E A53D 20B7 9C38 3EED 2747 EC48 A98D 4AF0 | |
To claim this, I am signing this object: |
This file contains 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
;; -*- mode: emacs-lisp -*- ;; | |
(require 'cl) | |
;; set up marmelade for package management | |
(require 'package) | |
(add-to-list 'package-archives | |
'("melpa" . "http://melpa.milkbox.net/packages/") t) |
This file contains 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
$(function () { | |
for(var i = 0; i < 10; i++) { | |
$("#active").append($("<div class='elem'>Block " + i + "</div>")); | |
} | |
$("#pointer").bind("mousedown", start); | |
}); | |
function start(event) { | |
window.startpos = parseInt($("#pointer").css("top")); | |
$(document).bind("mousemove", drag); |
This file contains 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
;; Control flow | |
;; basically, we provide a shadowed '^throw continuation, and then see what | |
;; we are handed. if it is an error (ie, an exception), we see if it matches | |
;; what we are catching, and if it doesn't, we re-throw. Since we are out of | |
;; scope of the current try/catch, we will now pick up whatever exception | |
;; continuation is outside. note that this obviously requires the entire program | |
;; to be wrapped in a try/catch that matches on everything (which it is). | |
[CTry | |
(bdy mat cat els) |
This file contains 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
#lang plai-typed | |
(require "python-micro-syntax.rkt" | |
"python-helpers.rkt") | |
(define (run-cps [e : UExp]) | |
(begin | |
(sym-reset) | |
(UApp (cps e) (UFn '^x (UId '^x))))) |
NewerOlder