free-functors 0.6 → 0.6.1
raw patch · 2 files changed
+6/−2 lines, 2 filesdep ~comonad
Dependency ranges changed: comonad
Files
- free-functors.cabal +2/−2
- src/Data/Functor/HCofree.hs +4/−0
free-functors.cabal view
@@ -1,5 +1,5 @@ name: free-functors-version: 0.6+version: 0.6.1 synopsis: Provides free functors that are adjoint to functors that forget class constraints. description: A free functor is a left adjoint to a forgetful functor. It used to be the case that the only category that was easy to work with in Haskell was Hask itself, so@@ -43,7 +43,7 @@ base >= 4.4 && < 5, constraints >= 0.3.2 && < 0.4, transformers >= 0.2.0.0 && < 0.4,- comonad >= 3.0 && < 3.2,+ comonad >= 4.0 && < 4.1, void >= 0.4 && < 0.7, algebraic-classes >= 0.5 && < 0.6, template-haskell >= 2.8.0.0 && < 2.8.1
src/Data/Functor/HCofree.hs view
@@ -24,6 +24,7 @@ module Data.Functor.HCofree where import Control.Comonad+import Control.Comonad.Trans.Class import Data.Foldable import Data.Traversable import Data.Functor.Identity@@ -60,6 +61,9 @@ lowerCofree :: HCofree c f a -> f a lowerCofree = counit++convert :: (c (t f), Functor (t f), Comonad f, ComonadTrans t) => t f a -> HCofree c f a+convert = leftAdjunct lower coiter :: c Identity => (forall b. b -> f b) -> a -> HCofree c f a coiter f = leftAdjunct (f . runIdentity) . Identity