Skip to content

Instantly share code, notes, and snippets.

View cpressey's full-sized avatar
🚚
Moved to codeberg.org/cpressey

Chris Pressey cpressey

🚚
Moved to codeberg.org/cpressey
View GitHub Profile
@cpressey
cpressey / Efficiently-Dull.md
Created October 23, 2022 10:39
"The League of Efficiently Dull Gentlemen"
@cpressey
cpressey / .bash_aliases
Created August 10, 2021 09:57
.bash_aliases
# 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
cpressey / OperationalSansGADTs.hs.md
Last active May 6, 2024 09:42
Operational monad sans GADTs
@cpressey
cpressey / PipelineCombinators.hs.md
Last active May 6, 2024 13:00
PipelineCombinators.hs
@cpressey
cpressey / Future directions for SixtyPical.md
Last active December 10, 2023 12:18
Future directions for SixtyPical
@cpressey
cpressey / Calling an anonymous function directly in various languages.md
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
cpressey / Programming Language Feature Desiderata.md
Last active December 3, 2023 14:55
Programming Language Feature Desiderata
@cpressey
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)
subject
(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
cpressey / Wagon.md
Last active December 10, 2023 13:50
Wagon.md
@cpressey
cpressey / Odd.hs
Last active July 26, 2019 12:12
Odd.hs
-- implementation of https://esolangs.org/wiki/An_Odd_Rewriting_System
-- 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