Skip to content

Instantly share code, notes, and snippets.

View rampion's full-sized avatar

Noah Luck Easterly rampion

  • Mercury Technologies
View GitHub Profile
@rampion
rampion / Makefile
Last active August 29, 2015 14:13
for some reason, I was tempted to play with dependency injection in C
fizzbuzz: depinjex.c main.c
gcc -o $@ $^
fizzbuzz-test: depinjex.c test.c
gcc -DENABLE_DEPENDENCY_INJECTION -o $@ $^
test: fizzbuzz-test
./$^
clean:
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE RankNTypes #-}
module Cascade where
import Control.Category
import Control.Comonad
<!doctype html>
<html lang="en" dir="ltr">
<head>
<meta charset="UTF-8">
</head>
<body>
</body>
</html>
@rampion
rampion / FunctorFun.hs
Last active August 29, 2015 14:06
Streams, Lists, and Tries with Fix and Compose
{-# LANGUAGE FlexibleContexts #-} -- {{{
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE PackageImports #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE TypeSynonymInstances #-}
{-# LANGUAGE UndecidableInstances #-} -- }}}
module FunctorFun where
-- {{{
{-# LANGUAGE GADTs #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE LambdaCase #-}
module SO25311781 where
import Data.Generics.Uniplate.Direct
data Expression a where
I :: Int -> Expression Int
@rampion
rampion / SO25210743.hs
Created August 10, 2014 03:03
Solution for "Bicategories in Haskell", replacing dependency on `Arr` with dependency on `Composable`
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE UndecidableInstances #-}
{-# LANGUAGE ScopedTypeVariables #-}
@rampion
rampion / SO25210743.hs
Last active August 29, 2015 14:05
Solution for [Bicategories in Haskell](http://stackoverflow.com/questions/25210743/bicategories-in-haskell) on StackOverflow
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE UndecidableInstances #-}
{-# LANGUAGE ScopedTypeVariables #-}
@rampion
rampion / Unique.hs
Last active August 29, 2015 14:02
Indexed Monad for uniquely consumed values
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE UndecidableInstances #-}
{-# LANGUAGE DeriveFunctor #-}
module Unique (
@rampion
rampion / 0-scenes.md
Last active January 4, 2016 18:39
Gonking One Shot

Scenes:

The City Gate:

  • The caravan gets ready to leave in the square next to the city gate, giving the characters a chance to make themselves known to each other.

  • Criers call out news.

  • It's the 20th anniversary of Dysus's departure for Thurb, and his widow,