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

Dyad

Maarten Fokkinga の Dyads。使い道は謎。 {-# LANGUAGE Arrows, MultiParamTypeClasses, FunctionalDependencies, TypeOperators #-} module Main where import Prelude import Control.Arrow import qualified Control.Category as Cat import Control.Mon…

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…