generic-deriving 1.10.3 → 1.10.4
raw patch · 3 files changed
+40/−5 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- CHANGELOG.md +5/−0
- generic-deriving.cabal +1/−1
- src/Generics/Deriving/Base/Internal.hs +34/−4
CHANGELOG.md view
@@ -1,3 +1,8 @@+# 1.10.4+* Backported `MonadPlus` and `MonadZip` instances for `U1`, and made the+ `Functor`, `Foldable`, `Traversable`, `Alternative`, and `Monad` instances+ for `U1` lazier to correspond with `base-4.9`+ # 1.10.3 * Backported `Enum`, `Bounded`, `Ix`, `Functor`, `Applicative`, `Monad`, `MonadFix`, `MonadPlus`, `MonadZip`, `Foldable`, `Traversable`, and
generic-deriving.cabal view
@@ -1,5 +1,5 @@ name: generic-deriving-version: 1.10.3+version: 1.10.4 synopsis: Generic programming library for generalised deriving. description:
src/Generics/Deriving/Base/Internal.hs view
@@ -669,18 +669,48 @@ -- | Unit: used for constructors without arguments data U1 p = U1- deriving (Eq, Ord, Read, Show, Functor, Foldable, Traversable, Data, Typeable)+ deriving (Eq, Ord, Read, Show, Data, Typeable)++instance Functor U1 where+ fmap _ _ = U1+ instance Applicative U1 where pure _ = U1- U1 <*> U1 = U1+ _ <*> _ = U1 instance Alternative U1 where empty = U1- U1 <|> U1 = U1+ _ <|> _ = U1 instance Monad U1 where return _ = U1- U1 >>= _ = U1+ _ >>= _ = U1++instance MonadPlus U1 where+ mzero = U1+ mplus _ _ = U1++instance Foldable U1 where+ foldMap _ _ = mempty+ {-# INLINE foldMap #-}+ fold _ = mempty+ {-# INLINE fold #-}+ foldr _ z _ = z+ {-# INLINE foldr #-}+ foldl _ z _ = z+ {-# INLINE foldl #-}+ foldl1 _ _ = error "foldl1: U1"+ foldr1 _ _ = error "foldr1: U1"++instance Traversable U1 where+ traverse _ _ = pure U1+ {-# INLINE traverse #-}+ sequenceA _ = pure U1+ {-# INLINE sequenceA #-}+ mapM _ _ = return U1+ {-# INLINE mapM #-}+ sequence _ = return U1+ {-# INLINE sequence #-} -- | Used for marking occurrences of the parameter newtype Par1 p = Par1 { unPar1 :: p }