Skip to content

Instantly share code, notes, and snippets.

View cpressey's full-sized avatar
Moved to

Chris Pressey cpressey

Moved to
View GitHub Profile
cpressey /
Created October 23, 2022 10:39
"The League of Efficiently Dull Gentlemen"
cpressey / .bash_aliases
Created August 10, 2021 09:57
# encoding: UTF-8
bind '"\e[A":history-search-backward'
bind '"\e[B":history-search-forward'
export PATH="$HOME/.cabal/bin:$HOME/.local/bin:$PATH"
export EDITOR=nano
alias unpyc="find . -name '*.pyc' -exec rm -f {} \;"
alias rsyncavd="rsync --archive --verbose --delete"
alias git-savepatch='git diff >'
alias chintzy-httpd='python2 -m SimpleHTTPServer'
cpressey /
Last active May 6, 2024 09:42
Operational monad sans GADTs
cpressey /
Last active May 6, 2024 13:00
cpressey / Future directions for
Last active December 10, 2023 12:18
Future directions for SixtyPical
cpressey / Calling an anonymous function directly in various
Last active June 1, 2020 15:55
Calling an anonymous function directly in various languages

Just a little survey of what code to create an anonymous function and immediately call it looks like in a handful of high-level languages. All of these expressions should evaluate to 10.

Language Code
Python (lambda x: x+1)(9)
Ruby (lambda {|x| x+1}).call(9)
Lua (function(x) return x+1 end)(9)
Erlang (fun(X) -> X+1 end)(9)
Haskell (\x -> x+1)(9)
cpressey / Programming Language Feature
Last active December 3, 2023 14:55
Programming Language Feature Desiderata
cpressey / dollar.scm
Created August 27, 2019 11:04
How Haskell's infix $ operator might look in Scheme
(define reduce
(lambda (subject complete-rules rules generation-id)
(if (null? rules)
(let* ((rule-pair (car rules))
(rest-of-rules (cdr rules))
(pattern (car rule-pair))
(replacements (cdr rule-pair))
(new-gen-id (+ generation-id 1))
(new-subject (apply-rule subject pattern replacements generation-id)))
cpressey /
Last active December 10, 2023 13:50
cpressey / Odd.hs
Last active July 26, 2019 12:12
-- implementation of
-- I, Chris Pressey, hereby place this source code into the public domain.
import Data.Char
-- A program in An Odd Rewriting System consists an alphabet of symbols,
-- each of which belongs to one of two categories (an odd symbol or an even symbol),
-- except for a special halt symbol that appears in neither category;
-- two definitions for each symbol (an odd definition and an even definition);
-- and an initial string. Both the initial string, and each definition, is simply a