module Control.Morphism.Chrono where
import Control.Comonad.Cofree
import Control.Functor.Algebra
import Control.Functor.Extras
import Control.Monad.Free
import Control.Morphism.Hylo
import Control.Morphism.Futu
import Control.Morphism.Histo
chrono :: (RunMonadFree f m, RunComonadCofree g w) => GAlgebra g w b -> (f :~> g) -> GCoalgebra f m a -> a -> b
chrono = g_hylo (distHisto id) (distFutu id)
g_chrono :: (Functor f, Functor g, RunComonadCofree h w, RunMonadFree j m) =>
Dist g h -> Dist j f -> GAlgebra g w b -> (f :~> g) -> GCoalgebra f m a -> a -> b
g_chrono h f = g_hylo (distHisto h) (distFutu f)