Skip to content

Instantly share code, notes, and snippets.

class (ctx t) => Free ctx t where
type El t :: *
foldMap :: ctx a => (El t -> a) -> (t -> a)
singleton :: El t -> t
map :: (Free ctx t0, Free ctx t1) => (El t0 -> El t1) -> (t0 -> t1)
map f = foldMap (singleton . f)
vhosts
nullable.se
serve: FSDirectory
directory: /var/www
nullable.se.dev
serve: FSDirectory
directory: /var/www
www.nullable.se
serve: Redirect
http://nullable.se/
bleh: bluh
->
bleh
bluh
,
bleh: bluh
@tailcalled
tailcalled / Parser.hs
Created October 19, 2012 20:08
Stuff
module Parser
import ImaginaryTTXTParser
import Data.Map
data Serve = Redirect String | FSDirectory String deriving (Show) -- Strings for simplification
data ConfigFile = ConfigFile (Map String Serve) deriving (Show)
vhosts (ConfigFile vhosts') = vhosts'