Permalink
Browse files

dep bump

  • Loading branch information...
1 parent b2b7d61 commit b88942162b766eaab0fb204ed925ce3315991a84 @ekmett committed Apr 9, 2012
Showing with 27 additions and 48 deletions.
  1. +14 −35 Data/Copointed.hs
  2. +5 −5 Data/Pointed.hs
  3. +8 −8 pointed.cabal
View
@@ -1,23 +1,17 @@
module Data.Copointed where
-import Control.Comonad
import Data.Default
-import Data.Functor.Identity
+import Data.Functor.Identity
import Data.Functor.Compose
import Data.Functor.Coproduct
import Data.Tree
import Data.Semigroup as Semigroup
import Control.Monad.Trans.Identity
import qualified Control.Monad.Trans.Writer.Lazy as Lazy
import qualified Control.Monad.Trans.Writer.Strict as Strict
-import qualified Control.Comonad.Trans.Discont.Lazy as Lazy
-import qualified Control.Comonad.Trans.Discont.Memo as Memo
-import qualified Control.Comonad.Trans.Discont.Strict as Strict
-import qualified Control.Comonad.Trans.Env.Lazy as Lazy
-import qualified Control.Comonad.Trans.Env.Strict as Strict
-import qualified Control.Comonad.Trans.Store.Lazy as Lazy
-import qualified Control.Comonad.Trans.Store.Memo as Memo
-import qualified Control.Comonad.Trans.Store.Strict as Strict
+import Control.Comonad.Trans.Env
+import Control.Comonad.Trans.Store
+import Control.Comonad.Trans.Traced
import Data.List.NonEmpty (NonEmpty(..))
-- | 'Copointed' does not require a 'Functor', as the only relationship
@@ -30,7 +24,10 @@ instance Copointed Identity where
copoint = runIdentity
instance Default m => Copointed ((->)m) where
- copoint f = f def
+ copoint f = f def
+
+instance (Default m, Copointed w) => Copointed (TracedT m w) where
+ copoint (TracedT w) = copoint w def
instance Copointed ((,) a) where
copoint = snd
@@ -54,10 +51,10 @@ instance Copointed m => Copointed (IdentityT m) where
copoint = copoint . runIdentityT
instance Copointed m => Copointed (Lazy.WriterT w m) where
- copoint = fst . copoint . Lazy.runWriterT
+ copoint = fst . copoint . Lazy.runWriterT
instance Copointed m => Copointed (Strict.WriterT w m) where
- copoint = fst . copoint . Strict.runWriterT
+ copoint = fst . copoint . Strict.runWriterT
instance Copointed Dual where
copoint = getDual
@@ -80,26 +77,8 @@ instance Copointed Semigroup.Max where
instance Copointed Semigroup.Min where
copoint = Semigroup.getMin
-instance Copointed (Lazy.DiscontT s w) where
- copoint (Lazy.DiscontT f w) = f w
-
-instance Copointed (Strict.DiscontT s w) where
- copoint (Strict.DiscontT f w) = f w
-
-instance Copointed (Memo.DiscontT s w) where
- copoint = extract
-
-instance Copointed w => Copointed (Lazy.EnvT e w) where
- copoint = copoint . Lazy.lowerEnvT
-
-instance Copointed w => Copointed (Strict.EnvT e w) where
- copoint = copoint . Strict.lowerEnvT
-
-instance Copointed w => Copointed (Lazy.StoreT s w) where
- copoint (Lazy.StoreT wf s) = copoint wf s
-
-instance Copointed w => Copointed (Strict.StoreT s w) where
- copoint (Strict.StoreT wf s) = copoint wf s
+instance Copointed w => Copointed (EnvT e w) where
+ copoint = copoint . lowerEnvT
-instance Copointed w => Copointed (Memo.StoreT s w) where
- copoint = copoint . Memo.lowerStoreT
+instance Copointed w => Copointed (StoreT s w) where
+ copoint (StoreT wf s) = copoint wf s
View
@@ -41,7 +41,7 @@ instance Pointed Maybe where
instance Pointed (Either a) where
point = Right
-
+
instance Pointed IO where
point = return
@@ -52,7 +52,7 @@ instance Pointed Tree where
point a = Node a []
instance Pointed NonEmpty where
- point a = a :| []
+ point a = a :| []
instance Pointed ZipList where
point = pure
@@ -67,7 +67,7 @@ instance Default e => Pointed ((,)e) where
point = (,) def
instance Monad m => Pointed (WrappedMonad m) where
- point = WrapMonad . return
+ point = WrapMonad . return
instance Default m => Pointed (Const m) where
point _ = Const def
@@ -117,7 +117,7 @@ instance (Pointed p, Pointed q) => Pointed (Compose p q) where
instance (Pointed p, Pointed q) => Pointed (Functor.Product p q) where
point a = Functor.Pair (point a) (point a)
-instance Default m => Pointed (Constant m) where
+instance Default m => Pointed (Constant m) where
point _ = Constant def
instance Pointed (ContT r m) where
@@ -151,7 +151,7 @@ instance (Default w, Pointed m) => Pointed (Strict.WriterT w m) where
point a = Strict.WriterT $ point (a, def)
instance Pointed m => Pointed (Lazy.StateT s m) where
- point a = Lazy.StateT $ \s -> point (a, s)
+ point a = Lazy.StateT $ \s -> point (a, s)
instance Pointed m => Pointed (Strict.StateT s m) where
point a = Strict.StateT $ \s -> point (a, s)
View
@@ -1,6 +1,6 @@
name: pointed
category: Data
-version: 2.0.3.2
+version: 2.1
license: BSD3
cabal-version: >= 1.6
license-file: LICENSE
@@ -20,14 +20,14 @@ source-repository head
library
build-depends:
base >= 4 && < 5,
- transformers >= 0.2.0 && < 0.3,
- containers >= 0.4.0.0 && < 0.5,
- data-default >= 0.2.0.1 && < 0.4,
- comonad >= 1.1.1.1 && < 1.2,
- semigroups >= 0.8 && < 0.9,
- semigroupoids >= 1.2.6.1 && < 1.3,
+ transformers >= 0.2 && < 0.4,
+ containers >= 0.4 && < 0.5,
+ data-default >= 0.4 && < 0.5,
+ comonad >= 1.1.1.3 && < 1.2,
+ semigroups >= 0.8.2 && < 0.9,
+ semigroupoids >= 1.3 && < 1.4,
stm >= 2.1.2.1 && < 2.4,
- comonad-transformers >= 2.0.3 && < 2.1
+ comonad-transformers >= 2.1 && < 2.2
exposed-modules:
Data.Pointed

0 comments on commit b889421

Please sign in to comment.