tagged-transformer 0.5 → 0.6
raw patch · 3 files changed
+6/−24 lines, 3 files
Files
- CHANGELOG.markdown +4/−0
- src/Data/Functor/Trans/Tagged.hs +1/−23
- tagged-transformer.cabal +1/−1
CHANGELOG.markdown view
@@ -1,3 +1,7 @@+0.6+---+* Removed `self`/`selfM`. Use `pure` and `return`.+ 0.5 --- * Updated dependencies
src/Data/Functor/Trans/Tagged.hs view
@@ -23,7 +23,7 @@ ( -- * Tagged values TaggedT(..)- , tag, self, selfM, untag+ , tag, untag , retag , mapTaggedT , reflected, reflectedM@@ -68,7 +68,6 @@ newtype TaggedT s m b = TagT { untagT :: m b } deriving ( Eq, Ord, Read, Show ) - instance Functor m => Functor (TaggedT s m) where fmap f (TagT x) = TagT (fmap f x) {-# INLINE fmap #-}@@ -109,7 +108,6 @@ TagT m >> TagT n = TagT (m >> n) {-# INLINE (>>) #-} - instance Alt m => Alt (TaggedT s m) where TagT a <!> TagT b = TagT (a <!> b) {-# INLINE (<!>) #-}@@ -135,7 +133,6 @@ mfix f = TagT $ mfix (untagT . f) {-# INLINE mfix #-} - instance MonadTrans (TaggedT s) where lift = TagT {-# INLINE lift #-}@@ -180,7 +177,6 @@ callCC f = lift . callCC $ \k -> untag (f (tag . k)) {-# INLINE callCC #-} - instance Foldable f => Foldable (TaggedT s f) where foldMap f (TagT x) = foldMap f x {-# INLINE foldMap #-}@@ -209,7 +205,6 @@ distribute = TagT . distribute . fmap untagT {-# INLINE distribute #-} - instance Extend f => Extend (TaggedT s f) where extended f (TagT w) = TagT (extended (f . TagT) w) {-# INLINE extended #-}@@ -218,7 +213,6 @@ extract (TagT w) = extract w {-# INLINE extract #-} - instance ComonadTrans (TaggedT s) where lower (TagT w) = w {-# INLINE lower #-}@@ -228,7 +222,6 @@ cohoist f = TagT . f . untagT {-# INLINE cohoist #-} - instance MonadCatch m => MonadCatch (TaggedT s m) where throwM e = lift $ throwM e {-# INLINE throwM #-}@@ -241,7 +234,6 @@ where q u = tag . u . untag {-# INLINE uninterruptibleMask#-} - -- | Easier to type alias for 'TagT' tag :: m b -> TaggedT s m b tag = TagT@@ -263,24 +255,11 @@ retag = tag . untag {-# INLINE retag #-} - -- | Lift an operation on underlying monad mapTaggedT :: (m a -> n b) -> TaggedT s m a -> TaggedT s n b mapTaggedT f = tag . f . untag {-# INLINE mapTaggedT #-} ---- | Tag value with its own type in 'Applicative' context-self :: Applicative m => a -> TaggedT a m a-self = tag . pure-{-# INLINE self #-}---- | Tag value with its own type in 'Monad' context-selfM :: Monad m => a -> TaggedT s m a-selfM = tag . return-{-# INLINE selfM #-}-- -- | Reflect reified value back in 'Applicative' context reflected :: forall s m a. (Applicative m, Reifies s a) => TaggedT s m a reflected = tag . pure . reflect $ (Proxy :: Proxy s)@@ -290,7 +269,6 @@ reflectedM :: forall s m a. (Monad m, Reifies s a) => TaggedT s m a reflectedM = tag . return . reflect $ (Proxy :: Proxy s) {-# INLINE reflectedM #-}- -- | 'asTaggedTypeOf' is a type-restricted version of 'const'. It is usually used as an infix operator, and its typing forces its first argument (which is usually overloaded) to have the same type as the tag of the second. asTaggedTypeOf :: s -> TaggedT s m b -> s
tagged-transformer.cabal view
@@ -1,5 +1,5 @@ name: tagged-transformer-version: 0.5+version: 0.6 license: BSD3 license-file: LICENSE author: Edward A. Kmett