Skip to content

Instantly share code, notes, and snippets.

@chrisdone
chrisdone / README.md
Last active May 2, 2024 21:40
Indexed fields exploration

Exploring possibilities with simple indexed fields

Database records and formlets and optionally populated records can be neatly all represented with the same data type when the fields are all indexed.

class Indexed i a where
  type Index i (a :: *)
@chrisdone
chrisdone / gist:02e165a0004be33734ac2334f215380e
Last active April 21, 2024 12:50
Build and run minimal Linux / Busybox systems in Qemu

Common

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

Linux kernel

@chrisdone
chrisdone / AnIntro.md
Last active March 24, 2024 21:13
Statically Typed Lisp

Basic unit type:

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

Basic functions:

@chrisdone
chrisdone / 0-PHOAS-total-evaluator.hs
Last active March 24, 2024 16:55
Various lambda-calculus implementations
-- λ> eval (A (L (\(C i) -> C (i * 2))) (C 2))
-- 4
{-# LANGUAGE GADTs #-}
data E a where
C :: a -> E a
L :: (E a -> E b) -> E (a -> b)
A :: E (a -> b) -> E a -> E b
@chrisdone
chrisdone / typing.md
Last active March 22, 2024 23:24
Typing Haskell in Haskell

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 March 22, 2024 12:41
Various type inference designs/sketches

Type Inference: Various Designs

I'm exploring the right data types for writing a type inference with higher kinds and poly types.

Putting more things in the type system can force you to think about more things, but it also can make it harder and more verbose to write and read algorithms.

@chrisdone
chrisdone / expression_problem.hs
Created November 2, 2016 11:34 — forked from elnygren/expression_problem.clj
Solving the Expression Problem with Haskell
{-# 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 / .gitignore
Last active January 25, 2024 16:07
Linux + BusyBox + QEMU/VirtualBox/USB boot recipe
output/
@chrisdone
chrisdone / Printf.idr
Last active December 8, 2023 00:02
Type-safe dependently-typed printf in Idris
module Printf
%default total
-- Formatting AST.
data Format
= FInt Format
| FString Format
| FOther Char Format
| FEnd
@chrisdone
chrisdone / readme.md
Last active December 7, 2023 16:10
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.

Motivation

Why a web frontend for Emacs?

  1. A web frontend would benefit from being cross-platform in the sense