Skip to content

Instantly share code, notes, and snippets.

View lambdageek's full-sized avatar
🪣

Aleksey Kliger (λgeek) lambdageek

🪣
View GitHub Profile
@ekmett
ekmett / TypedNBE.hs
Last active September 7, 2020 19:37
Typed normalization-by-evaluation using a slowed category action
{-# Language CPP #-}
{-# Language BlockArguments #-}
{-# Language GADTs #-}
{-# Language RankNTypes #-}
{-# Language ViewPatterns #-}
{-# Language TypeApplications #-}
{-# Language BangPatterns #-}
{-# Language TypeOperators #-}
{-# Language TypeFamilyDependencies #-}
{-# Language DataKinds #-}
static const AssemblyVersionMap framework_assemblies [] = {
{"Accessibility", 0},
{"Commons.Xml.Relaxng", 0},
{"I18N", 0},
{"I18N.CJK", 0},
{"I18N.MidEast", 0},
{"I18N.Other", 0},
{"I18N.Rare", 0},
{"I18N.West", 0},
{"Microsoft.Build.Engine", 2, NULL, TRUE},
@marcan
marcan / linux.sh
Last active July 21, 2024 14:00
Linux kernel initialization, translated to bash
#!/boot/bzImage
# Linux kernel userspace initialization code, translated to bash
# (Minus floppy disk handling, because seriously, it's 2017.)
# Not 100% accurate, but gives you a good idea of how kernel init works
# GPLv2, Copyright 2017 Hector Martin <[email protected]>
# Based on Linux 4.10-rc2.
# Note: pretend chroot is a builtin and affects the current process
# Note: kernel actually uses major/minor device numbers instead of device name
@tel
tel / Profunctor.js
Last active April 3, 2019 01:51
"Pure-profunctor" lenses in Javascript (!)
/// PRELIMINARIES
/**
* Generalized "products" of any size. For gluing things together. A tuple is a
* "2"-meet.
*
* The type `Meet a b c d ...` indicates a `Meet` of the given size with values
* at each type in the sequence.
*/
@tel
tel / CBPV.hs
Last active August 29, 2015 14:12
PHOAS Call-by-push-value... Kind of!
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE LambdaCase #-}
-- Code obviously based on <http://andrej.com/plzoo/html/levy.html>
-- This is right now *not really* CBPV. In particular, the Rec binder
-- is both less well-behaved and far more complex than it ought to
-- be. Instead of passing a computation back (which should never be
-- possible as variables do not have computation types) it should pass
-- back a thunk.
@gallais
gallais / reornament.agda
Last active May 12, 2016 07:41
Algebraic Ornaments!
module reornament where
open import Data.Product
open import Data.Nat
open import Data.List
ListAlg : (A B : Set) → Set
ListAlg A B = B × (A → B → B)
data ListSpec (A : Set) {B : Set} (alg : ListAlg A B) : (b : B) → Set where
@mzero
mzero / ghc-clang-wrapper
Created October 31, 2013 06:53
This wrapper script *should* enable GHC 7.* to work on systems with Xcode 5. To use it, drop this script somewhere, make it executable, and run.... Then follow the instructions it prints out. What it will do is, instruction you to put a copy in /usr/bin, then re-run it sudo. It will then find all your GHC 7 settings files, and patch them to make…
#!/bin/sh
inPreprocessorMode () {
hasE=0
hasU=0
hasT=0
for arg in "$@"
do
if [ 'x-E' = "x$arg" ]; then hasE=1; fi
if [ 'x-undef' = "x$arg" ]; then hasU=1; fi
@copumpkin
copumpkin / Unify.agda
Last active July 6, 2019 13:59
Structurally recursive unification à la McBride
module Unify where
-- Translated from http://strictlypositive.org/unify.ps.gz
open import Data.Empty
import Data.Maybe as Maybe
open Maybe hiding (map)
open import Data.Nat
open import Data.Fin
open import Data.Product hiding (map)
@davetron5000
davetron5000 / requirements.md
Created June 22, 2012 15:26
My Ideal Presentation Software

davetron5000's ideal presentation software

  • Editable as text, preferably markdown
  • Plays in a browser
  • Deployable to heroku or other service completely statically
  • clean default look that is easy to customize without slogging through generated HTML
  • hard-fix the dimensions, e.g. 1024x768 for projectors
  • support for remote control for advancing

Slide Types

@takumikinjo
takumikinjo / .gitignore
Created August 5, 2010 13:56
HTML5 Presentation export for Org-mode
README.html