prelude-extras 0.3.1 → 0.4
raw patch · 3 files changed
+16/−1 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ Prelude.Extras: instance Foldable (f a) => Foldable (Lift2 f a)
+ Prelude.Extras: instance Foldable f => Foldable (Lift1 f)
+ Prelude.Extras: instance Functor (f a) => Functor (Lift2 f a)
+ Prelude.Extras: instance Functor f => Functor (Lift1 f)
+ Prelude.Extras: instance Traversable (f a) => Traversable (Lift2 f a)
+ Prelude.Extras: instance Traversable f => Traversable (Lift1 f)
Files
- CHANGELOG.markdown +8/−0
- prelude-extras.cabal +1/−1
- src/Prelude/Extras.hs +7/−0
CHANGELOG.markdown view
@@ -1,3 +1,11 @@+0.4+---+* Derived `Functor`, `Foldable`, and `Traversable` for `Lift1` and `Lift2`++0.3.1+-----+* Fixed a broken `#ifdef`+ 0.3 --- * Restructured so users can take advantage of default signatures
prelude-extras.cabal view
@@ -1,6 +1,6 @@ name: prelude-extras category: Polymorphism, Combinators-version: 0.3.1+version: 0.4 license: BSD3 cabal-version: >= 1.2 license-file: LICENSE
src/Prelude/Extras.hs view
@@ -1,4 +1,7 @@ {-# LANGUAGE CPP #-}+{-# LANGUAGE DeriveFunctor #-}+{-# LANGUAGE DeriveFoldable #-}+{-# LANGUAGE DeriveTraversable #-} #if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ > 702 #define DEFAULT_SIGNATURES {-# LANGUAGE DefaultSignatures #-}@@ -33,6 +36,8 @@ ) where import Control.Arrow (first)+import Data.Foldable+import Data.Traversable import Text.Read import qualified Text.ParserCombinators.ReadP as P import qualified Text.Read.Lex as L@@ -316,6 +321,7 @@ return (x:xs) newtype Lift1 f a = Lift1 { lower1 :: f a }+ deriving (Functor, Foldable, Traversable) instance Eq1 f => Eq1 (Lift1 f) where Lift1 a ==# Lift1 b = a ==# b instance Ord1 f => Ord1 (Lift1 f) where Lift1 a `compare1` Lift1 b = compare1 a b@@ -330,6 +336,7 @@ readsPrec d = map (first Lift1) . readsPrec1 d newtype Lift2 f a b = Lift2 { lower2 :: f a b }+ deriving (Functor, Foldable, Traversable) instance Eq2 f => Eq2 (Lift2 f) where Lift2 a ==## Lift2 b = a ==## b instance Ord2 f => Ord2 (Lift2 f) where Lift2 a `compare2` Lift2 b = compare2 a b