Skip to content

Instantly share code, notes, and snippets.

View danking's full-sized avatar

Dan King danking

View GitHub Profile
T[[#1 e]] = T[[e]] (λ x. λ y. x)
T[[(e₁, e₂)]] = λ f. f T[[e₁]] T[[e₂]]
T[[(e₁, e₂)]] = (λ x. λ y. λ f. f x y) T[[e₁]] T[[e₂]]
p = (λx.x, Ω)
* CBN w/ pairs
T[[#1 e]] = T[[e]] (λ x. λ y. x)
T[[(e₁, e₂)]] = λ f. f T[[e₁]] T[[e₂]]
T[[(e₁, e₂)]] = (λ x. λ y. λ f. f x y) T[[e₁]] T[[e₂]]
T[[Ω]] = (λ x . (x •) (x •)) (λ_. λ x. (x •) (x •))
p = (λx.x, Ω)

Keybase proof

I hereby claim:

  • I am danking on github.
  • I am danking (https://keybase.io/danking) on keybase.
  • I have a public key whose fingerprint is 674F E774 16FE 8E97 E226 35FE 9FDB E002 5BA6 55AA

To claim this, I am signing this object:

instance Monoid a => Monoid [(Either a b)] where
mempty = []
mappend [] vs = vs
mappend vs [] = vs
mappend [(Left v1)] ((Left v2):vs) = (Left $ mappend v1 v2):vs
mappend (v1:v2:vs) vs' = v1 : (mappend (v2:vs) vs')
@danking
danking / Makefile
Last active August 29, 2015 14:21
The challenge problem for Real Semantics' final presentation challenge in cs260r Spring 2015 (http://read-new.seas.harvard.edu/cs260r/2015/w/Main_Page)
BITCODEFILES=test.bc challenge.bc
READABLEFILES=test.ll challenge.ll
LLVM_LINK=./llvm-link
REAL_LLI=../llvm-3.6.0/build/bin/lli
default: $(BITCODEFILES)
$(LLVM_LINK) $(BITCODEFILES) -o a.bc
readable: $(READABLEFILES)
- fun [] append ys = ys
| (x :: xs) append ys = x :: (xs append ys);
stdIn:6.12-6.14 Error: illegal function symbol in clause
stdIn:6.12-7.48 Error: clauses don't all have same function name
stdIn:6.12-7.48 Error: clauses don't all have same number of patterns
stdIn:6.12-7.48 Error: types of rules don't agree [tycon mismatch]
(* sml *)
fun [] append ys = ys
| (x :: xs) append ys = x :: (xs append ys);
require 'test/unit'
class ParameterizedTestCase < Test::Unit::TestCase
def self.suite
method_names = public_instance_methods(true)
target_method_names = method_names.find_all do |method_name|
method_name =~ /^ptest./
end
puts "target_method_names: #{target_method_names.inspect}"
class MechanicTest < ParameterizedTestCase
@@parameter_parameterized = [["Car", Car.new],
["Bike", Motorcycle.new],
["Truck", Truck.new]]
def ptest_operateOnCar(vehicle)
myMechanic = Mechanic.new
myMechanic.operate(vehicle)
assert !vehicle.broken?
end
@danking
danking / scsh-command-tables-tests-log.scm
Created October 31, 2010 21:52
A scsh error output
Welcome to scsh 0.7
Type ,? for help.
> ,exec ,load load.scm
warning: name from opened structure redefined [package-define!]
#{package 285 config}
srfi-43
#{structure 95 more-structures}
warning: name from opened structure redefined [package-define!]