Skip to content

Instantly share code, notes, and snippets.

@chrisdone
chrisdone / typing.md
Last active August 18, 2024 09:54
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

@paf31
paf31 / Main.hs
Last active September 5, 2018 03:54
A simple type checker with Rank N types
module Main where
import Data.Maybe (fromMaybe)
import Control.Applicative
import Control.Arrow (first)
import Control.Monad (ap)
import Debug.Trace
@soupi
soupi / Lisp.hs
Last active October 30, 2023 10:45
A transpiler from a simple S-expression language to JS
{-# LANGUAGE LambdaCase #-}
-- http://gilmi.xyz/post/2016/10/14/lisp-to-js
module Main where
import Control.Applicative (Alternative, empty, (<|>))
import Control.Arrow (first, (***))
import Data.Bool (bool)
import Data.List (intercalate)
@nwolverson
nwolverson / package-from-bower.sh
Created March 9, 2017 21:07
create psc-package.json from bower.json
#!/bin/bash
SET=${1:-"erl-0.10.5"}
SOURCE=${2:-"https://github.com/purerl/package-sets.git"}
if [ ! -f "psc-package.json" ]; then
jq < bower.json "{name, set: \"$SET\", source: \"$SOURCE\", depends: [] }" > psc-package.json
fi
jq < bower.json '.dependencies | keys | map(gsub("purescript-";"")) | join("\n")' -r | while read -r line ; do
psc-package install $line;
@LukaJCB
LukaJCB / Algebra.purs
Last active September 22, 2019 13:01
Alternative Tagless Final encoding in PureScript
module Algebra where
import Prelude
import Control.Monad.Eff (Eff)
import Data.Maybe (Maybe(..))
newtype ConsoleAlg f = ConsoleAlg
{ printLn :: String -> f Unit
, readLn :: f String