uniform-pair 0.1.8 → 0.1.9
raw patch · 2 files changed
+8/−4 lines, 2 filesdep +deepseqPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependencies added: deepseq
API changes (from Hackage documentation)
- Data.UniformPair: instance Applicative Pair
- Data.UniformPair: instance Eq a => Eq (Pair a)
- Data.UniformPair: instance Foldable Pair
- Data.UniformPair: instance Functor Pair
- Data.UniformPair: instance Monad Pair
- Data.UniformPair: instance Monoid a => Monoid (Pair a)
- Data.UniformPair: instance Ord a => Ord (Pair a)
- Data.UniformPair: instance Show a => Show (Pair a)
- Data.UniformPair: instance ShowF Pair
- Data.UniformPair: instance Traversable Pair
+ Data.UniformPair: instance Control.DeepSeq.NFData a => Control.DeepSeq.NFData (Data.UniformPair.Pair a)
+ Data.UniformPair: instance Data.Foldable.Foldable Data.UniformPair.Pair
+ Data.UniformPair: instance Data.Traversable.Traversable Data.UniformPair.Pair
+ Data.UniformPair: instance GHC.Base.Applicative Data.UniformPair.Pair
+ Data.UniformPair: instance GHC.Base.Functor Data.UniformPair.Pair
+ Data.UniformPair: instance GHC.Base.Monad Data.UniformPair.Pair
+ Data.UniformPair: instance GHC.Base.Monoid a => GHC.Base.Monoid (Data.UniformPair.Pair a)
+ Data.UniformPair: instance GHC.Classes.Eq a => GHC.Classes.Eq (Data.UniformPair.Pair a)
+ Data.UniformPair: instance GHC.Classes.Ord a => GHC.Classes.Ord (Data.UniformPair.Pair a)
+ Data.UniformPair: instance GHC.Show.Show a => GHC.Show.Show (Data.UniformPair.Pair a)
+ Data.UniformPair: instance Text.ShowF.ShowF Data.UniformPair.Pair
Files
- src/Data/UniformPair.hs +6/−2
- uniform-pair.cabal +2/−2
src/Data/UniformPair.hs view
@@ -24,6 +24,7 @@ import Data.Foldable (Foldable(..)) import Data.Traversable (Traversable(..)) import Control.Applicative (Applicative(..)) -- ,liftA2+import Control.DeepSeq (NFData(..)) import Text.ShowF (ShowF(..)) @@ -34,6 +35,9 @@ -- instance Traversable Pair where sequenceA (u :# v) = (:#) <$> u <*> v +instance NFData a => NFData (Pair a) where+ rnf (a :# b) = rnf a `seq` rnf b+ instance ShowF Pair where showsPrecF = showsPrec @@ -89,8 +93,8 @@ -- | Extract an element, indexing by 'False' for the first element and 'True' -- for the second. getP :: Bool -> Pair a -> a-getP False (a :# _) = a-getP True (_ :# b) = b+getP False = fstP+getP True = sndP -- Compare and swap compareSwap :: Ord a => Pair a -> Pair a
uniform-pair.cabal view
@@ -1,5 +1,5 @@ Name: uniform-pair-Version: 0.1.8+Version: 0.1.9 Cabal-Version: >= 1.6 Synopsis: Uniform pairs with class instances Category: Data@@ -22,7 +22,7 @@ Library hs-Source-Dirs: src Extensions:- Build-Depends: base<5, ShowF+ Build-Depends: base<5, ShowF, deepseq Exposed-Modules: Data.UniformPair ghc-options: -Wall