module Vinyl.Effects.Types where
data Apply a f where
Apply :: (Functor f) => f a -> Apply a f
getApply :: Apply a f -> f a
getApply (Apply fa) = fa
type AnAlgebra f a = f a -> a
newtype Algebra f a = Algebra { getAlgebra ::
AnAlgebra f a
}
newtype OpAlgebra a f = OpAlgebra { getOpAlgebra ::
AnAlgebra f a
}
type ACoAlgebra f a = a -> f a
newtype CoAlgebra f a = CoAlgebra { getCoAlgebra ::
ACoAlgebra f a
}
newtype OpCoAlgebra a f = OpCoAlgebra { getOpCoAlgebra ::
ACoAlgebra f a
}
type (:~>) f g = forall x. f x -> g x
type ANaturalTransformation f g = (:~>) f g
newtype NaturalTransformation f g = NaturalTransformation { getNaturalTransformation ::
f :~> g
}
newtype IdNaturalTransformation f = IdNaturalTransformation { getIdNaturalTransformation ::
forall x. ACoAlgebra f x
}
newtype OpNaturalTransformation g f = OpNaturalTransformation { getOpNaturalTransformation ::
f :~> g
}
newtype IdOpNaturalTransformation f = IdOpNaturalTransformation { getIdOpNaturalTransformation ::
forall x. AnAlgebra f x
}
type IsPairing f g = (Functor f, Functor g)
data Pairing f g = Pairing { pair ::
forall a b r. (a -> b -> r) -> (f a -> g b -> r)
}