Skip to content

Instantly share code, notes, and snippets.

View michaelt's full-sized avatar

michaelt michaelt

  • twitter antiphasis_
View GitHub Profile
@michaelt
michaelt / gist:5568429
Last active December 17, 2015 06:49 — forked from reite/gist:5568152
{-#LANGUAGE OverloadedStrings#-}
import Data.Aeson.Types
import Data.Aeson
import qualified Data.Vector as V
import qualified Data.ByteString.Lazy as L
import Data.HashMap.Strict
import qualified Data.Text as T
-- this is backward maybe -- also doesn't crack open the Values
import Control.Monad
import Control.Concurrent
import Control.Concurrent.STM
import System.Random
import Text.Printf
-- Forks
type Fork = TMVar Int
newFork :: Int -> IO Fork
@michaelt
michaelt / RedBlackTree.hs
Created May 11, 2012 15:01 — forked from rampion/RedBlackTree.hs
red-black trees in haskell, using GADTs and Zippers (and DataKinds)
{-# LANGUAGE GADTs #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE DataKinds#-}
{-# LANGUAGE KindSignatures#-}
module RedBlackTree where
data Nat = Zero | Succ Nat deriving (Eq, Ord, Show)
type One = Succ Zero