kan-extensions 2.4.0.1 → 2.5
raw patch · 3 files changed
+11/−1 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ Data.Functor.KanExtension: instance (Functor g, Applicative h) => Applicative (Lan g h)
Files
- .travis.yml +1/−0
- Data/Functor/KanExtension.hs +6/−0
- kan-extensions.cabal +4/−1
+ .travis.yml view
@@ -0,0 +1,1 @@+language: haskell
Data/Functor/KanExtension.hs view
@@ -15,6 +15,7 @@ import Data.Functor.Identity import Data.Functor.Adjunction import Data.Functor.Composition+import Control.Applicative newtype Ran g h a = Ran { runRan :: forall b. (a -> g b) -> h b } @@ -58,6 +59,11 @@ instance Functor (Lan f g) where fmap f (Lan g h) = Lan (f . g) h++instance (Functor g, Applicative h) => Applicative (Lan g h) where+ pure a = Lan (const a) (pure ())+ Lan kxf x <*> Lan kya y =+ Lan (\k -> kxf (fmap fst k) (kya (fmap snd k))) (liftA2 (,) x y) adjointToLan :: Adjunction f g => g a -> Lan f Identity a adjointToLan = Lan counit . Identity
kan-extensions.cabal view
@@ -1,6 +1,6 @@ name: kan-extensions category: Data Structures, Monads, Comonads, Functors-version: 2.4.0.1+version: 2.5 license: BSD3 cabal-version: >= 1.6 license-file: LICENSE@@ -8,10 +8,13 @@ maintainer: Edward A. Kmett <ekmett@gmail.com> stability: provisional homepage: http://github.com/ekmett/kan-extensions/+bug-reports: http://github.com/ekmett/kan-extensions/issues copyright: Copyright (C) 2011 Edward A. Kmett synopsis: Kan extensions, the Yoneda lemma, and (co)density (co)monads description: Kan extensions, the Yoneda lemma, and (co)density (co)monads build-type: Simple++extra-source-files: .travis.yml source-repository head type: git