Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/ruby
require 'json'
DESC_HEAD = /^\.([^\.\[]+)/
DEREF_HEAD = /^\[(\d+)\]/
def usage
$stderr.puts <<USAGE
usage: json descriptor
@tonymorris
tonymorris / Category.hs
Created December 30, 2012 18:27
Beyond Category
{-# LANGUAGE NoImplicitPrelude, TypeOperators #-}
import Prelude(undefined, Either(..), either, Functor(..))
data Store a b =
Store (a -> b) a
instance Functor (Store a) where
fmap f (Store p g) =
Store (f . p) g