packages feed

mono-traversable 1.0.1.2 → 1.0.1.3

raw patch · 3 files changed

+12/−3 lines, 3 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

Files

ChangeLog.md view
@@ -1,3 +1,7 @@+## 1.0.1.3++* Make 'olength' for Set and Map O(1) [#125](https://github.com/snoyberg/mono-traversable/pull/125)+ ## 1.0.1.2  * Support for GHC 8.2
mono-traversable.cabal view
@@ -1,5 +1,5 @@ name:                mono-traversable-version:             1.0.1.2+version:             1.0.1.3 synopsis:            Type classes for mapping, folding, and traversing monomorphic containers description:         Monomorphic variants of the Functor, Foldable, and Traversable typeclasses. If you understand Haskell's basic typeclasses, you understand mono-traversable. In addition to what you are used to, it adds on an IsSequence typeclass and has code for marking data structures as non-empty. homepage:            https://github.com/snoyberg/mono-traversable
src/Data/MonoTraversable.hs view
@@ -62,6 +62,7 @@ import Data.List.NonEmpty (NonEmpty) import Data.Functor.Identity (Identity) import Data.Map (Map)+import qualified Data.Map.Strict as Map import Data.HashMap.Strict (HashMap) import Data.Vector (Vector) import Control.Monad.Trans.Maybe (MaybeT (..))@@ -598,7 +599,9 @@ instance MonoFoldable (Option a) instance MonoFoldable (NonEmpty a) instance MonoFoldable (Identity a)-instance MonoFoldable (Map k v)+instance MonoFoldable (Map k v) where+    olength = Map.size+    {-# INLINE olength #-} instance MonoFoldable (HashMap k v) instance MonoFoldable (Vector a) where     ofoldr = V.foldr@@ -630,7 +633,9 @@     {-# INLINE unsafeHead #-}     {-# INLINE maximumByEx #-}     {-# INLINE minimumByEx #-}-instance MonoFoldable (Set e)+instance MonoFoldable (Set e) where+    olength = Set.size+    {-# INLINE olength #-} instance MonoFoldable (HashSet e)  instance U.Unbox a => MonoFoldable (U.Vector a) where