Skip to content

Instantly share code, notes, and snippets.

View dmwit's full-sized avatar

Daniel Wagner dmwit

View GitHub Profile
@dmwit
dmwit / stdin.txt
Last active December 16, 2015 03:09 — forked from anonymous/stdin.txt
{-# LANGUAGE TypeFamilies #-}
type family StateFor a
type instance StateFor Integer = ()
type instance StateFor (a, b) = (StateFor a, StateFor b)
type instance StateFor [a] = (Integer, [StateFor a])
class ReadObj a where
readObj :: StateFor a -> [[String]] -> (a, [[String]])