2011-08-01から1日間の記事一覧

Template Haskellで遊ぶ

Ross Patersonの論文に面白いデータ構造「homogeneous functions」があって: type Pair a = (a, a) data BalTree a = Zero a | Succ (BalTree (Pair a)) deriving (Show) -- the homogeneous functions data Hom a b = ( a -> b ) :&: Hom (Pair a) (Pair b…