packages feed

representable-functors 0.1.0.2 → 0.2.0

raw patch · 2 files changed

+6/−4 lines, 2 files

Files

Data/Functor/Representable.hs view
@@ -53,13 +53,13 @@ import Data.Monoid import Prelude hiding (lookup) --- | A 'Functor' @f@ is 'Representable' if 'tabulate' and 'index' witness a monad isomorphism to @(->) x@.+-- | A 'Functor' @f@ is 'Representable' if 'tabulate' and 'index' witness an isomorphism to @(->) x@. -- -- > tabulate . index = id -- > index . tabulate = id -- > tabulate . return f = return f -class (Index f, Distributive f, Keyed f, Apply f, Applicative f, Bind f, Monad f) => Representable f where+class (Index f, Distributive f, Keyed f, Apply f, Applicative f {- , Bind f, Monad f -}) => Representable f where   -- | > fmap f . tabulate = tabulate . fmap f   tabulate :: (Key f -> a) -> f a @@ -125,8 +125,9 @@ instance Representable w => Representable (TracedT s w) where   tabulate = TracedT . collect tabulate . curry --- * Orphans +{-+-- * Orphans instance (Representable f, Bind m) => Bind (Compose f m) where   Compose fm >>- f = Compose $ tabulate (\a -> index fm a >>- flip index a . getCompose . f) @@ -140,4 +141,5 @@ instance (Representable f, Monad m) => Monad (Compose f m) where   return = Compose . pure . return   Compose fm >>= f = Compose $ tabulate (\a -> index fm a >>= flip index a . getCompose . f)+-} 
representable-functors.cabal view
@@ -1,6 +1,6 @@ name:          representable-functors category:      Monads, Functors, Data Structures-version:       0.1.0.2+version:       0.2.0 license:       BSD3 cabal-version: >= 1.6 license-file:  LICENSE