kan-extensions (empty) → 0.1
raw patch · 8 files changed
+649/−0 lines, 8 filesdep +adjunctionsdep +arraydep +basesetup-changed
Dependencies added: adjunctions, array, base, comonad, comonad-transformers, containers, contravariant, distributive, keys, mtl, representable-functors, semigroupoids, semigroups, transformers
Files
- Control/Comonad/Density.hs +50/−0
- Control/Monad/Codensity.hs +62/−0
- Data/Functor/KanExtension.hs +81/−0
- Data/Functor/Yoneda.hs +205/−0
- Data/Functor/Yoneda/Contravariant.hs +169/−0
- LICENSE +30/−0
- Setup.lhs +7/−0
- kan-extensions.cabal +45/−0
+ Control/Comonad/Density.hs view
@@ -0,0 +1,50 @@+{-# LANGUAGE MultiParamTypeClasses, GADTs #-}+-----------------------------------------------------------------------------+-- |+-- Module : Control.Comonad.Density+-- Copyright : (C) 2008-2011 Edward Kmett+-- License : BSD-style (see the file LICENSE)+--+-- Maintainer : Edward Kmett <ekmett@gmail.com>+-- Stability : experimental+-- Portability : non-portable (GADTs, MPTCs)+--+-- The density comonad for a functor. aka the comonad generated by a functor+-- The ''density'' term dates back to Dubuc''s 1974 thesis. The term +-- ''monad genererated by a functor'' dates back to 1972 in Street''s +-- ''Formal Theory of Monads''.+----------------------------------------------------------------------------+module Control.Comonad.Density+ ( DensityT(..)+ , liftDensityT+ , densityTToAdjunction, adjunctionToDensityT+ ) where++import Control.Comonad+import Control.Comonad.Trans.Class+import Data.Functor.Adjunction++data DensityT k a where+ DensityT :: (k b -> a) -> k b -> DensityT k a++instance Functor (DensityT f) where+ fmap f (DensityT g h) = DensityT (f . g) h++instance Extend (DensityT f) where+ duplicate (DensityT f ws) = DensityT (DensityT f) ws++instance Comonad (DensityT f) where+ extract (DensityT f a) = f a++instance ComonadTrans DensityT where+ lower (DensityT f c) = extend f c+ +-- | The natural isomorphism between a comonad w and the comonad generated by w (forwards).+liftDensityT :: Comonad w => w a -> DensityT w a+liftDensityT = DensityT extract ++densityTToAdjunction :: Adjunction f g => DensityT f a -> f (g a)+densityTToAdjunction (DensityT f v) = fmap (leftAdjunct f) v++adjunctionToDensityT :: Adjunction f g => f (g a) -> DensityT f a+adjunctionToDensityT = DensityT counit
+ Control/Monad/Codensity.hs view
@@ -0,0 +1,62 @@+{-# LANGUAGE Rank2Types #-}+-----------------------------------------------------------------------------+-- |+-- Module : Control.Monad.Codensity+-- Copyright : (C) 2008-2011 Edward Kmett+-- License : BSD-style (see the file LICENSE)+--+-- Maintainer : Edward Kmett <ekmett@gmail.com>+-- Stability : provisional+-- Portability : non-portable (rank-2 polymorphism)+--+----------------------------------------------------------------------------+module Control.Monad.Codensity+ ( CodensityT(..)+ , lowerCodensityT+ , codensityTToAdjunction+ , adjunctionToCodensityT+ ) where++import Control.Applicative+import Control.Monad (ap)+import Data.Functor.Adjunction+import Data.Functor.Apply+import Control.Monad.Trans.Class+import Control.Monad.IO.Class++{-+type Codensity = CodensityT Identity+codensity :: (forall b. (a -> b) -> b) -> Codensity a+runCodensity :: Codensity a -> (a -> b) -> a+-}++newtype CodensityT m a = CodensityT { runCodensityT :: forall b. (a -> m b) -> m b }++instance Functor (CodensityT k) where+ fmap f (CodensityT m) = CodensityT (\k -> m (k . f))++instance Apply (CodensityT f) where+ (<.>) = ap++instance Applicative (CodensityT f) where+ pure x = CodensityT (\k -> k x)+ (<*>) = ap++instance Monad (CodensityT f) where+ return x = CodensityT (\k -> k x)+ m >>= k = CodensityT (\c -> runCodensityT m (\a -> runCodensityT (k a) c))++instance MonadIO m => MonadIO (CodensityT m) where+ liftIO = lift . liftIO ++instance MonadTrans CodensityT where+ lift m = CodensityT (m >>=)++lowerCodensityT :: Monad m => CodensityT m a -> m a+lowerCodensityT a = runCodensityT a return++codensityTToAdjunction :: Adjunction f g => CodensityT g a -> g (f a)+codensityTToAdjunction r = runCodensityT r unit++adjunctionToCodensityT :: Adjunction f g => g (f a) -> CodensityT g a+adjunctionToCodensityT f = CodensityT (\a -> fmap (rightAdjunct a) f)
+ Data/Functor/KanExtension.hs view
@@ -0,0 +1,81 @@+{-# LANGUAGE Rank2Types, GADTs #-}+-------------------------------------------------------------------------------------------+-- |+-- Module : Data.Functor.KanExtension+-- Copyright : 2008-2011 Edward Kmett+-- License : BSD+--+-- Maintainer : Edward Kmett <ekmett@gmail.com>+-- Stability : experimental+-- Portability : rank 2 types+--+-------------------------------------------------------------------------------------------+module Data.Functor.KanExtension where++import Data.Functor.Identity+import Data.Functor.Adjunction+import Data.Functor.Composition++newtype Ran g h a = Ran { runRan :: forall b. (a -> g b) -> h b }++instance Functor (Ran g h) where+ fmap f m = Ran (\k -> runRan m (k . f))+ +-- | 'toRan' and 'fromRan' witness a higher kinded adjunction. from @(`'Compose'` g)@ to @'Ran' g@+toRan :: (Composition compose, Functor k) => (forall a. compose k g a -> h a) -> k b -> Ran g h b+toRan s t = Ran (s . compose . flip fmap t)++fromRan :: Composition compose => (forall a. k a -> Ran g h a) -> compose k g b -> h b+fromRan s = flip runRan id . s . decompose++composeRan :: Composition compose => Ran f (Ran g h) a -> Ran (compose f g) h a+composeRan r = Ran (\f -> runRan (runRan r (decompose . f)) id)++decomposeRan :: (Composition compose, Functor f) => Ran (compose f g) h a -> Ran f (Ran g h) a+decomposeRan r = Ran (\f -> Ran (\g -> runRan r (compose . fmap g . f)))++adjointToRan :: Adjunction f g => f a -> Ran g Identity a+adjointToRan f = Ran (\a -> Identity $ rightAdjunct a f)++ranToAdjoint :: Adjunction f g => Ran g Identity a -> f a+ranToAdjoint r = runIdentity (runRan r unit)++ranToComposedAdjoint :: (Composition compose, Adjunction f g) => Ran g h a -> compose h f a+ranToComposedAdjoint r = compose (runRan r unit)++composedAdjointToRan :: (Composition compose, Adjunction f g, Functor h) => compose h f a -> Ran g h a+composedAdjointToRan f = Ran (\a -> fmap (rightAdjunct a) (decompose f))++data Lan g h a where+ Lan :: (g b -> a) -> h b -> Lan g h a++-- 'fromLan' and 'toLan' witness a (higher kinded) adjunction between @'Lan' g@ and @(`Compose` g)@+toLan :: (Composition compose, Functor f) => (forall a. h a -> compose f g a) -> Lan g h b -> f b+toLan s (Lan f v) = fmap f . decompose $ s v++fromLan :: (Composition compose) => (forall a. Lan g h a -> f a) -> h b -> compose f g b+fromLan s = compose . s . Lan id++instance Functor (Lan f g) where+ fmap f (Lan g h) = Lan (f . g) h++adjointToLan :: Adjunction f g => g a -> Lan f Identity a+adjointToLan = Lan counit . Identity++lanToAdjoint :: Adjunction f g => Lan f Identity a -> g a+lanToAdjoint (Lan f v) = leftAdjunct f (runIdentity v)++-- | 'lanToComposedAdjoint' and 'composedAdjointToLan' witness the natural isomorphism between @Lan f h@ and @Compose h g@ given @f -| g@+lanToComposedAdjoint :: (Composition compose, Functor h, Adjunction f g) => Lan f h a -> compose h g a+lanToComposedAdjoint (Lan f v) = compose (fmap (leftAdjunct f) v)++composedAdjointToLan :: Composition compose => Adjunction f g => compose h g a -> Lan f h a+composedAdjointToLan = Lan counit . decompose++-- | 'composeLan' and 'decomposeLan' witness the natural isomorphism from @Lan f (Lan g h)@ and @Lan (f `o` g) h@+composeLan :: (Composition compose, Functor f) => Lan f (Lan g h) a -> Lan (compose f g) h a+composeLan (Lan f (Lan g h)) = Lan (f . fmap g . decompose) h++decomposeLan :: Composition compose => Lan (compose f g) h a -> Lan f (Lan g h) a+decomposeLan (Lan f h) = Lan (f . compose) (Lan id h)+
+ Data/Functor/Yoneda.hs view
@@ -0,0 +1,205 @@+{-# LANGUAGE TypeFamilies, CPP, Rank2Types, FlexibleContexts, MultiParamTypeClasses, UndecidableInstances #-}+-----------------------------------------------------------------------------+-- |+-- Module : Data.Functor.Yoneda+-- Copyright : (C) 2011 Edward Kmett+-- License : BSD-style (see the file LICENSE)+--+-- Maintainer : Edward Kmett <ekmett@gmail.com>+-- Stability : provisional+-- Portability : MPTCs, fundeps+--+----------------------------------------------------------------------------++module Data.Functor.Yoneda+ ( Yoneda+ , yoneda+ , runYoneda+ , liftYoneda+ , lowerYoneda+ , YonedaT(..)+ , liftYonedaT+ , lowerYonedaT+ , maxF, minF, maxM, minM+ ) where++import Control.Applicative+import Control.Monad (MonadPlus(..), liftM)+import Control.Monad.Fix+import Control.Monad.Representable+import Control.Monad.Trans.Class+import Control.Comonad+import Control.Comonad.Trans.Class+import Data.Distributive+import Data.Foldable+import Data.Function (on)+import Data.Functor.Plus+import Data.Functor.Identity+import Data.Functor.Bind+import Data.Functor.Adjunction+import Data.Key+-- import Data.Semigroup+import Data.Semigroup.Foldable+import Data.Semigroup.Traversable+import Data.Traversable+import Text.Read hiding (lift)+import Prelude hiding (sequence, lookup)++type Yoneda = YonedaT Identity ++yoneda :: (forall b. (a -> b) -> b) -> Yoneda a+yoneda f = YonedaT (Identity . f)+{-# INLINE yoneda #-}++runYoneda :: Yoneda a -> (a -> b) -> b+runYoneda (YonedaT f) = runIdentity . f+{-# INLINE runYoneda #-}++liftYoneda :: a -> Yoneda a+liftYoneda a = YonedaT (\f -> Identity (f a))+{-# INLINE liftYoneda #-}++lowerYoneda :: Yoneda a -> a+lowerYoneda m = runIdentity (runYonedaT m id)+{-# INLINE lowerYoneda #-}++newtype YonedaT f a = YonedaT { runYonedaT :: forall b. (a -> b) -> f b } ++liftYonedaT :: Functor f => f a -> YonedaT f a +liftYonedaT a = YonedaT (\f -> fmap f a)++lowerYonedaT :: YonedaT f a -> f a +lowerYonedaT (YonedaT f) = f id++{-# RULES "lower/lift=id" liftYonedaT . lowerYonedaT = id #-}+{-# RULES "lift/lower=id" lowerYonedaT . liftYonedaT = id #-}++instance Functor (YonedaT f) where+ fmap f m = YonedaT (\k -> runYonedaT m (k . f))++type instance Key (YonedaT f) = Key f++instance Keyed f => Keyed (YonedaT f) where+ mapWithKey f = liftYonedaT . mapWithKey f . lowerYonedaT ++instance Apply f => Apply (YonedaT f) where+ YonedaT m <.> YonedaT n = YonedaT (\f -> m (f .) <.> n id)+ +instance Applicative f => Applicative (YonedaT f) where+ pure a = YonedaT (\f -> pure (f a))+ YonedaT m <*> YonedaT n = YonedaT (\f -> m (f .) <*> n id)++instance Foldable f => Foldable (YonedaT f) where+ foldMap f = foldMap f . lowerYonedaT++instance Foldable1 f => Foldable1 (YonedaT f) where+ foldMap1 f = foldMap1 f . lowerYonedaT++instance FoldableWithKey f => FoldableWithKey (YonedaT f) where+ foldMapWithKey f = foldMapWithKey f . lowerYonedaT++instance FoldableWithKey1 f => FoldableWithKey1 (YonedaT f) where+ foldMapWithKey1 f = foldMapWithKey1 f . lowerYonedaT++instance Traversable f => Traversable (YonedaT f) where+ traverse f = fmap liftYonedaT . traverse f . lowerYonedaT++instance TraversableWithKey f => TraversableWithKey (YonedaT f) where+ traverseWithKey f = fmap liftYonedaT . traverseWithKey f . lowerYonedaT++instance Traversable1 f => Traversable1 (YonedaT f) where+ traverse1 f = fmap liftYonedaT . traverse1 f . lowerYonedaT++instance TraversableWithKey1 f => TraversableWithKey1 (YonedaT f) where+ traverseWithKey1 f = fmap liftYonedaT . traverseWithKey1 f . lowerYonedaT++instance Distributive f => Distributive (YonedaT f) where+ collect f = liftYonedaT . collect (lowerYonedaT . f)++instance Index f => Index (YonedaT f) where+ index = index . lowerYonedaT++instance Lookup f => Lookup (YonedaT f) where+ lookup i = lookup i . lowerYonedaT++instance Representable g => Representable (YonedaT g) where+ tabulate = liftYonedaT . tabulate++instance Adjunction f g => Adjunction (YonedaT f) (YonedaT g) where+ unit = liftYonedaT . fmap liftYonedaT . unit+ counit (YonedaT m) = counit (m lowerYonedaT)++-- instance Show1 f => Show1 (YonedaT f) where+instance Show (f a) => Show (YonedaT f a) where+ showsPrec d (YonedaT f) = showParen (d > 10) $+ showString "liftYonedaT " . showsPrec 11 (f id)++-- instance Read1 f => Read1 (YonedaT f) where+#ifdef __GLASGOW_HASKELL__+instance (Functor f, Read (f a)) => Read (YonedaT f a) where+ readPrec = parens $ prec 10 $ do+ Ident "liftYonedaT" <- lexP+ liftYonedaT <$> step readPrec+#endif++instance Eq (f a) => Eq (YonedaT f a) where+ (==) = (==) `on` lowerYonedaT++instance Ord (f a) => Ord (YonedaT f a) where+ compare = compare `on` lowerYonedaT++maxF :: (Functor f, Ord (f a)) => YonedaT f a -> YonedaT f a -> YonedaT f a+YonedaT f `maxF` YonedaT g = liftYonedaT $ f id `max` g id+-- {-# RULES "max/maxF" max = maxF #-}+{-# INLINE maxF #-}++minF :: (Functor f, Ord (f a)) => YonedaT f a -> YonedaT f a -> YonedaT f a+YonedaT f `minF` YonedaT g = liftYonedaT $ f id `max` g id+-- {-# RULES "min/minF" min = minF #-}+{-# INLINE minF #-}++maxM :: (Monad m, Ord (m a)) => YonedaT m a -> YonedaT m a -> YonedaT m a+YonedaT f `maxM` YonedaT g = lift $ f id `max` g id+-- {-# RULES "max/maxM" max = maxM #-}+{-# INLINE maxM #-}++minM :: (Monad m, Ord (m a)) => YonedaT m a -> YonedaT m a -> YonedaT m a+YonedaT f `minM` YonedaT g = lift $ f id `min` g id+-- {-# RULES "min/minM" min = minM #-}+{-# INLINE minM #-}++instance Alt f => Alt (YonedaT f) where+ YonedaT f <!> YonedaT g = YonedaT (\k -> f k <!> g k)++instance Plus f => Plus (YonedaT f) where+ zero = YonedaT $ const zero++instance Alternative f => Alternative (YonedaT f) where+ empty = YonedaT $ const empty+ YonedaT f <|> YonedaT g = YonedaT (\k -> f k <|> g k)++instance Bind m => Bind (YonedaT m) where+ YonedaT m >>- k = YonedaT (\f -> m id >>- \a -> runYonedaT (k a) f)+ +instance Monad m => Monad (YonedaT m) where+ return a = YonedaT (\f -> return (f a))+ YonedaT m >>= k = YonedaT (\f -> m id >>= \a -> runYonedaT (k a) f)++instance MonadFix m => MonadFix (YonedaT m) where+ mfix f = lift $ mfix (lowerYonedaT . f)++instance MonadPlus m => MonadPlus (YonedaT m) where+ mzero = YonedaT (const mzero)+ YonedaT f `mplus` YonedaT g = YonedaT (\k -> f k `mplus` g k)++instance MonadTrans YonedaT where+ lift a = YonedaT (\f -> liftM f a)++instance Extend w => Extend (YonedaT w) where+ extend k (YonedaT m) = YonedaT (\f -> extend (f . k . liftYonedaT) (m id))++instance Comonad w => Comonad (YonedaT w) where+ extract = extract . lowerYonedaT ++instance ComonadTrans YonedaT where+ lower = lowerYonedaT
+ Data/Functor/Yoneda/Contravariant.hs view
@@ -0,0 +1,169 @@+{-# LANGUAGE CPP, GADTs, FlexibleContexts, MultiParamTypeClasses, UndecidableInstances, TypeFamilies #-}+-----------------------------------------------------------------------------+-- |+-- Module : Data.Functor.Yoneda.Contravariant+-- Copyright : (C) 2011 Edward Kmett+-- License : BSD-style (see the file LICENSE)+--+-- Maintainer : Edward Kmett <ekmett@gmail.com>+-- Stability : provisional+-- Portability : GADTs, MPTCs, fundeps+--+----------------------------------------------------------------------------+module Data.Functor.Yoneda.Contravariant+ ( Yoneda+ , yoneda+ , liftYoneda+ , lowerYoneda+ , liftYonedaT+ , lowerYonedaT+ , lowerM+ , YonedaT(..)+ ) where++import Control.Applicative+import Control.Monad (MonadPlus(..), liftM)+import Control.Monad.Fix+import Control.Monad.Representable+import Control.Monad.Trans.Class+import Control.Comonad+import Control.Comonad.Trans.Class+import Data.Distributive+import Data.Function (on)+import Data.Functor.Bind+import Data.Functor.Plus+import Data.Functor.Identity+import Data.Functor.Adjunction+import Data.Key+import Prelude hiding (sequence)+import Text.Read hiding (lift)++type Yoneda = YonedaT Identity++-- | The contravariant Yoneda lemma applied to a covariant functor+data YonedaT f a where+ YonedaT :: (b -> a) -> f b -> YonedaT f a++yoneda :: (b -> a) -> b -> Yoneda a+yoneda f = YonedaT f . Identity++liftYoneda :: a -> Yoneda a +liftYoneda = YonedaT id . Identity++lowerYoneda :: Yoneda a -> a+lowerYoneda (YonedaT f (Identity a)) = f a++liftYonedaT :: f a -> YonedaT f a +liftYonedaT = YonedaT id++lowerYonedaT :: Functor f => YonedaT f a -> f a+lowerYonedaT (YonedaT f m) = fmap f m++lowerM :: Monad f => YonedaT f a -> f a +lowerM (YonedaT f m) = liftM f m++instance Functor (YonedaT f) where+ fmap f (YonedaT g v) = YonedaT (f . g) v++type instance Key (YonedaT f) = Key f++instance Keyed f => Keyed (YonedaT f) where+ mapWithKey f (YonedaT k a) = YonedaT id $ mapWithKey (\x -> f x . k) a++instance Apply f => Apply (YonedaT f) where+ m <.> n = liftYonedaT $ lowerYonedaT m <.> lowerYonedaT n++instance Applicative f => Applicative (YonedaT f) where+ pure = liftYonedaT . pure+ m <*> n = liftYonedaT $ lowerYonedaT m <*> lowerYonedaT n++instance Alternative f => Alternative (YonedaT f) where+ empty = liftYonedaT empty + m <|> n = liftYonedaT $ lowerYonedaT m <|> lowerYonedaT n++instance Alt f => Alt (YonedaT f) where+ m <!> n = liftYonedaT $ lowerYonedaT m <!> lowerYonedaT n++instance Plus f => Plus (YonedaT f) where+ zero = liftYonedaT zero++instance Bind m => Bind (YonedaT m) where+ YonedaT f v >>- k = liftYonedaT (v >>- lowerYonedaT . k . f)++instance Monad m => Monad (YonedaT m) where+ return = YonedaT id . return+ YonedaT f v >>= k = lift (v >>= lowerM . k . f)++instance MonadTrans YonedaT where+ lift = YonedaT id++instance MonadFix f => MonadFix (YonedaT f) where+ mfix f = lift $ mfix (lowerM . f)++instance MonadPlus f => MonadPlus (YonedaT f) where+ mzero = lift mzero+ m `mplus` n = lift $ lowerM m `mplus` lowerM n++instance (Functor f, Index f) => Index (YonedaT f) where+ index = index . lowerYonedaT++instance Representable f => Representable (YonedaT f) where+ tabulate = liftYonedaT . tabulate++instance Extend w => Extend (YonedaT w) where+ extend k (YonedaT f v) = YonedaT id $ extend (k . YonedaT f) v++instance Comonad w => Comonad (YonedaT w) where+ extract (YonedaT f v) = f (extract v)++instance ComonadTrans YonedaT where+ lower (YonedaT f a) = fmap f a++instance Foldable f => Foldable (YonedaT f) where+ foldMap f (YonedaT k a) = foldMap (f . k) a++instance FoldableWithKey f => FoldableWithKey (YonedaT f) where+ foldMapWithKey f (YonedaT k a) = foldMapWithKey (\x -> f x . k) a++instance Foldable1 f => Foldable1 (YonedaT f) where+ foldMap1 f (YonedaT k a) = foldMap1 (f . k) a++instance FoldableWithKey1 f => FoldableWithKey1 (YonedaT f) where+ foldMapWithKey1 f (YonedaT k a) = foldMapWithKey1 (\x -> f x . k) a++instance Traversable f => Traversable (YonedaT f) where+ traverse f (YonedaT k a) = YonedaT id <$> traverse (f . k) a++instance Traversable1 f => Traversable1 (YonedaT f) where+ traverse1 f (YonedaT k a) = YonedaT id <$> traverse1 (f . k) a++instance TraversableWithKey f => TraversableWithKey (YonedaT f) where+ traverseWithKey f (YonedaT k a) = YonedaT id <$> traverseWithKey (\x -> f x . k) a++instance TraversableWithKey1 f => TraversableWithKey1 (YonedaT f) where+ traverseWithKey1 f (YonedaT k a) = YonedaT id <$> traverseWithKey1 (\x -> f x . k) a++instance Distributive f => Distributive (YonedaT f) where+ collect f = liftYonedaT . collect (lowerYonedaT . f)++instance (Functor f, Show (f a)) => Show (YonedaT f a) where+ showsPrec d (YonedaT f a) = showParen (d > 10) $+ showString "liftYonedaT " . showsPrec 11 (fmap f a)++#ifdef __GLASGOW_HASKELL__+instance (Functor f, Read (f a)) => Read (YonedaT f a) where+ readPrec = parens $ prec 10 $ do+ Ident "liftYonedaT" <- lexP+ liftYonedaT <$> step readPrec+#endif++instance (Functor f, Eq (f a)) => Eq (YonedaT f a) where+ (==) = (==) `on` lowerYonedaT++instance (Functor f, Ord (f a)) => Ord (YonedaT f a) where+ compare = compare `on` lowerYonedaT++instance Adjunction f g => Adjunction (YonedaT f) (YonedaT g) where+ unit = liftYonedaT . fmap liftYonedaT . unit+ counit = counit . fmap lowerYonedaT . lowerYonedaT+
+ LICENSE view
@@ -0,0 +1,30 @@+Copyright 2011 Edward Kmett++All rights reserved.++Redistribution and use in source and binary forms, with or without+modification, are permitted provided that the following conditions+are met:++1. Redistributions of source code must retain the above copyright+ notice, this list of conditions and the following disclaimer.++2. Redistributions in binary form must reproduce the above copyright+ notice, this list of conditions and the following disclaimer in the+ documentation and/or other materials provided with the distribution.++3. Neither the name of the author nor the names of his contributors+ may be used to endorse or promote products derived from this software+ without specific prior written permission.++THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR+IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE+DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR+ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS+OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,+STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN+ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE+POSSIBILITY OF SUCH DAMAGE.
+ Setup.lhs view
@@ -0,0 +1,7 @@+#!/usr/bin/runhaskell+> module Main (main) where++> import Distribution.Simple++> main :: IO ()+> main = defaultMain
+ kan-extensions.cabal view
@@ -0,0 +1,45 @@+name: kan-extensions+category: Data Structures, Monads, Comonads, Functors+version: 0.1+license: BSD3+cabal-version: >= 1.6+license-file: LICENSE+author: Edward A. Kmett+maintainer: Edward A. Kmett <ekmett@gmail.com>+stability: provisional+homepage: http://github.com/ekmett/adjunctions/+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++source-repository head+ type: git+ location: git://github.com/ekmett/adjunctions.git++library+ build-depends: + adjunctions >= 0.7 && < 0.8,+ array >= 0.3.0.2 && < 0.4,+ base >= 4 && < 4.4,+ comonad >= 1.0 && < 1.1,+ comonad-transformers >= 1.5.1 && < 1.6,+ containers >= 0.4 && < 0.5,+ contravariant >= 0.1.2 && < 0.2,+ distributive >= 0.1.1 && < 0.2,+ keys >= 0.1.0.1 && < 0.2,+ mtl >= 2.0.1.0 && < 2.1,+ representable-functors >= 0.1.0.1 && < 0.2,+ semigroups >= 0.3.4 && < 0.4,+ semigroupoids >= 1.1.1 && < 1.2.0,+ transformers >= 0.2.0 && < 0.3++ exposed-modules:+ Control.Comonad.Density+ Control.Monad.Codensity+ Data.Functor.KanExtension+ Data.Functor.Yoneda+ Data.Functor.Yoneda.Contravariant++ ghc-options: -Wall+