packages feed

profunctor-extras 0.1.1 → 0.1.2

raw patch · 2 files changed

+22/−1 lines, 2 filesdep ~base

Dependency ranges changed: base

Files

+ Data/Profunctor/Collage.hs view
@@ -0,0 +1,20 @@+{-# LANGUAGE GADTs, FlexibleInstances, UndecidableInstances #-}+module Data.Profunctor.Collage +  ( Collage(..)+  ) where++import Data.Semigroupoid+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)
profunctor-extras.cabal view
@@ -1,6 +1,6 @@ name:          profunctor-extras category:      Control, Categories-version:       0.1.1+version:       0.1.2 license:       BSD3 cabal-version: >= 1.6 license-file:  LICENSE@@ -26,5 +26,6 @@    exposed-modules:     Data.Profunctor.Composition+    Data.Profunctor.Collage    ghc-options:      -Wall