Skip to content

Instantly share code, notes, and snippets.

@chrisdone
chrisdone / gist:02e165a0004be33734ac2334f215380e
Last active Nov 30, 2020
Build and run minimal Linux / Busybox systems in Qemu
View gist:02e165a0004be33734ac2334f215380e

Common

export OPT=/opt
export BUILDS=/some/where/mini_linux
mkdir -p $BUILDS

Linux kernel

@chrisdone
chrisdone / typing.md
Last active Nov 9, 2020
Typing Haskell in Haskell
View typing.md

Typing Haskell in Haskell

MARK P. JONES

Pacific Software Research Center

Department of Computer Science and Engineering

Oregon Graduate Institute of Science and Technology

@chrisdone
chrisdone / 0README.md
Last active Nov 8, 2020
total-eval.hs
View 0README.md

Total (non-error-throwing) lambda-calculus evaluators.

@chrisdone
chrisdone / readme.md
Last active Nov 6, 2020
Idea: A web frontend for Emacs via CodeMirror
View readme.md

Idea: A web frontend for Emacs via CodeMirror

This is a discussion/thought-process document with my ideas that I've been adding to recently.

Motivation

Why a web frontend for Emacs?

  1. A web frontend would benefit from being cross-platform in the sense
@chrisdone
chrisdone / expression_problem.hs
Created Nov 2, 2016 — forked from elnygren/expression_problem.clj
Solving the Expression Problem with Haskell
View expression_problem.hs
{-# LANGUAGE NamedFieldPuns #-}
-- The Expression Problem and my sources:
-- http://stackoverflow.com/questions/3596366/what-is-the-expression-problem
-- http://blog.ontoillogical.com/blog/2014/10/18/solving-the-expression-problem-in-clojure/
-- http://eli.thegreenplace.net/2016/the-expression-problem-and-its-solutions/
-- http://www.ibm.com/developerworks/library/j-clojure-protocols/
-- To begin demonstrating the problem, we first need some
@chrisdone
chrisdone / Printf.idr
Last active Sep 20, 2020
Type-safe dependently-typed printf in Idris
View Printf.idr
module Printf
%default total
-- Formatting AST.
data Format
= FInt Format
| FString Format
| FOther Char Format
| FEnd
@chrisdone
chrisdone / AnIntro.md
Last active Aug 21, 2020
Statically Typed Lisp
View AnIntro.md

Basic unit type:

λ> replTy "()"
() :: ()

Basic functions:

View gosper hurwitz.txt
Appendix 2
Continued Fraction Arithmetic
by
@chrisdone
chrisdone / Intro.md
Last active Aug 12, 2020
Statically checked overloaded strings
View Intro.md

Statically checked overloaded strings

This gist demonstrates a trick I came up with which is defining IsString for Q (TExp a), where a is lift-able. This allows you to write $$("...") and have the string parsed at compile-time.

This offers a light-weight way to enforce compile-time constraints. It's basically OverloadedStrings with static checks.

This trick works already in existing (old) GHCs.

@chrisdone
chrisdone / DBAPI.hs
Last active Aug 3, 2020
Defaulting fields in a record in Haskell
View DBAPI.hs
{-# LANGUAGE DataKinds #-}
-- | My database API.
module DBAPI where
import Data.Defaults
data ConnSpec p = ConnSpec
{ username :: !(Required p String)
You can’t perform that action at this time.