Skip to content

Instantly share code, notes, and snippets.

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


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

Linux kernel

chrisdone /
Last active Nov 9, 2020
Typing Haskell in Haskell

Typing Haskell in Haskell


Pacific Software Research Center

Department of Computer Science and Engineering

Oregon Graduate Institute of Science and Technology

chrisdone /
Last active Nov 8, 2020

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

chrisdone /
Last active Nov 6, 2020
Idea: A web frontend for Emacs via CodeMirror

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.


Why a web frontend for Emacs?

  1. A web frontend would benefit from being cross-platform in the sense
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:
-- To begin demonstrating the problem, we first need some
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 /
Last active Aug 21, 2020
Statically Typed Lisp

Basic unit type:

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

Basic functions:

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

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 / 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.