pointed 4.0 → 4.1
raw patch · 2 files changed
+26/−2 lines, 2 filesdep ~transformers
Dependency ranges changed: transformers
Files
- pointed.cabal +2/−2
- src/Data/Pointed.hs +24/−0
pointed.cabal view
@@ -1,6 +1,6 @@ name: pointed category: Data-version: 4.0+version: 4.1 license: BSD3 cabal-version: >= 1.6 license-file: LICENSE@@ -22,7 +22,7 @@ library build-depends: base >= 4 && < 5,- transformers >= 0.2 && < 0.4,+ transformers >= 0.2 && < 0.5, containers >= 0.4 && < 0.6, comonad >= 4 && < 5, data-default-class >= 0.0.1 && < 0.1,
src/Data/Pointed.hs view
@@ -19,8 +19,16 @@ import Data.Functor.Constant import qualified Data.Functor.Product as Functor import Data.Functor.Compose+#if MIN_VERSION_transformers(0,4,0)+import Data.Functor.Reverse+import Control.Applicative.Backwards+import Control.Applicative.Lift+#endif import Control.Monad.Trans.Cont import Control.Monad.Trans.Error+#if MIN_VERSION_transformers(0,4,0)+import Control.Monad.Trans.Except+#endif import Control.Monad.Trans.List import Control.Monad.Trans.Maybe import Control.Monad.Trans.Identity@@ -126,6 +134,17 @@ instance (Pointed p, Pointed q) => Pointed (Compose p q) where point = Compose . point . point +#if MIN_VERSION_transformers(0,4,0)+instance Pointed f => Pointed (Reverse f) where+ point = Reverse . point++instance Pointed f => Pointed (Backwards f) where+ point = Backwards . point++instance Pointed (Lift f) where+ point = Pure+#endif+ instance (Pointed p, Pointed q) => Pointed (Functor.Product p q) where point a = Functor.Pair (point a) (point a) @@ -137,6 +156,11 @@ instance Pointed m => Pointed (ErrorT e m) where point = ErrorT . point . Right++#if MIN_VERSION_transformers(0,4,0)+instance Pointed m => Pointed (ExceptT e m) where+ point = ExceptT . point . Right+#endif instance Pointed m => Pointed (IdentityT m) where point = IdentityT . point