packages feed

profunctor-extras 0.3.2.3 → 3.0

raw patch · 7 files changed

+82/−80 lines, 7 filesdep ~comonaddep ~profunctorsdep ~semigroupoid-extrasPVP ok

version bump matches the API change (PVP)

Dependency ranges changed: comonad, profunctors, semigroupoid-extras, semigroupoids

API changes (from Hackage documentation)

Files

− Data/Profunctor/Collage.hs
@@ -1,28 +0,0 @@-{-# LANGUAGE GADTs, FlexibleInstances, UndecidableInstances, MultiParamTypeClasses #-}-{-# OPTIONS_GHC -fno-warn-incomplete-patterns #-}-module Data.Profunctor.Collage -  ( Collage(..)-  ) where--import Data.Semigroupoid-import Data.Semigroupoid.Ob-import Data.Semigroupoid.Coproduct (L, R)-import Data.Profunctor---- | The cograph of a profunctor-data Collage k b a where-  L :: (b -> b') -> Collage k (L b) (L b')-  R :: (a -> a') -> Collage k (R a) (R a')-  C :: k b a     -> Collage k (L b) (R a)-  -instance Profunctor k => Semigroupoid (Collage k) where-  L f `o` L g = L (f . g)-  R f `o` R g = R (f . g) -  R f `o` C g = C (rmap f g)-  C f `o` L g = C (lmap g f)--instance Profunctor k => Ob (Collage k) (L a) where-  semiid = L semiid--instance Profunctor k => Ob (Collage k) (R a) where-  semiid = R semiid
− Data/Profunctor/Composition.hs
@@ -1,32 +0,0 @@-{-# LANGUAGE GADTs #-}-module Data.Profunctor.Composition -  ( Procompose(..)-  , proidl-  , proidr-  , coproidl-  , coproidr-  ) where--import Data.Profunctor--data Procompose f g d c where-  Procompose :: f d a -> g a c -> Procompose f g d c --instance (Profunctor f, Profunctor g) => Profunctor (Procompose f g) where-  lmap k (Procompose f g) = Procompose (lmap k f) g-  rmap k (Procompose f g) = Procompose f (rmap k g)--instance Profunctor g => Functor (Procompose f g a) where-  fmap k (Procompose f g) = Procompose f (rmap k g)--proidl :: Profunctor g => Procompose (->) g d c -> g d c -proidl (Procompose f g) = lmap f g--proidr :: Profunctor f => Procompose f (->) d c -> f d c-proidr (Procompose f g) = rmap g f--coproidl :: g d c -> Procompose (->) g d c-coproidl = Procompose id--coproidr :: f d c -> Procompose f (->) d c-coproidr g = Procompose g id
− Data/Profunctor/Trace.hs
@@ -1,8 +0,0 @@-{-# LANGUAGE GADTs #-}-module Data.Profunctor.Trace-  ( Trace(..)-  ) where---- | Coend of profunctor from Hask -> Hask-data Trace f where-  Trace :: f a a -> Trace f
profunctor-extras.cabal view
@@ -1,6 +1,6 @@ name:             profunctor-extras category:         Control, Categories-version:          0.3.2.3+version:          3.0 license:          BSD3 cabal-version:    >= 1.6 license-file:     LICENSE@@ -20,16 +20,20 @@   location: git://github.com/ekmett/profunctor-extras.git  library-  other-extensions:   GADTs-                      FlexibleInstances-                      UndecidableInstances-                      MultiParamTypeClasses+  hs-source-dirs: src++  other-extensions:+    GADTs+    FlexibleInstances+    UndecidableInstances+    MultiParamTypeClasses+   build-depends:-    base                >= 4       && < 5,-    semigroupoids       >= 1.3.1.2 && < 1.4,-    semigroupoid-extras >= 0.2.7.1 && < 0.3,-    comonad             >= 1.1.1.5 && < 1.2,-    profunctors         >= 0.1.2.2 && < 0.2+    base                == 4.*,+    semigroupoids       == 3.0.*,+    semigroupoid-extras == 3.0.*,+    comonad             == 3.0.*,+    profunctors         == 3.0.*    exposed-modules:     Data.Profunctor.Composition@@ -37,5 +41,3 @@     Data.Profunctor.Trace    ghc-options:      -Wall--
+ src/Data/Profunctor/Collage.hs view
@@ -0,0 +1,28 @@+{-# LANGUAGE GADTs, FlexibleInstances, UndecidableInstances, MultiParamTypeClasses #-}+{-# OPTIONS_GHC -fno-warn-incomplete-patterns #-}+module Data.Profunctor.Collage +  ( Collage(..)+  ) where++import Data.Semigroupoid+import Data.Semigroupoid.Ob+import Data.Semigroupoid.Coproduct (L, R)+import Data.Profunctor++-- | The cograph of a profunctor+data Collage k b a where+  L :: (b -> b') -> Collage k (L b) (L b')+  R :: (a -> a') -> Collage k (R a) (R a')+  C :: k b a     -> Collage k (L b) (R a)+  +instance Profunctor k => Semigroupoid (Collage k) where+  L f `o` L g = L (f . g)+  R f `o` R g = R (f . g) +  R f `o` C g = C (rmap f g)+  C f `o` L g = C (lmap g f)++instance Profunctor k => Ob (Collage k) (L a) where+  semiid = L semiid++instance Profunctor k => Ob (Collage k) (R a) where+  semiid = R semiid
+ src/Data/Profunctor/Composition.hs view
@@ -0,0 +1,32 @@+{-# LANGUAGE GADTs #-}+module Data.Profunctor.Composition +  ( Procompose(..)+  , proidl+  , proidr+  , coproidl+  , coproidr+  ) where++import Data.Profunctor++data Procompose f g d c where+  Procompose :: f d a -> g a c -> Procompose f g d c ++instance (Profunctor f, Profunctor g) => Profunctor (Procompose f g) where+  lmap k (Procompose f g) = Procompose (lmap k f) g+  rmap k (Procompose f g) = Procompose f (rmap k g)++instance Profunctor g => Functor (Procompose f g a) where+  fmap k (Procompose f g) = Procompose f (rmap k g)++proidl :: Profunctor g => Procompose (->) g d c -> g d c +proidl (Procompose f g) = lmap f g++proidr :: Profunctor f => Procompose f (->) d c -> f d c+proidr (Procompose f g) = rmap g f++coproidl :: g d c -> Procompose (->) g d c+coproidl = Procompose id++coproidr :: f d c -> Procompose f (->) d c+coproidr g = Procompose g id
+ src/Data/Profunctor/Trace.hs view
@@ -0,0 +1,8 @@+{-# LANGUAGE GADTs #-}+module Data.Profunctor.Trace+  ( Trace(..)+  ) where++-- | Coend of profunctor from Hask -> Hask+data Trace f where+  Trace :: f a a -> Trace f