git.iko.soy/typeable/refined-containers
on main help sign in
5 files changed+10−7
since splitsnapshots
unifiedsplit
refined-containers.cabal+1−1 src/Data/HashMap/Common/Refined.hs+3−3 src/Data/HashMap/Refined.hs+2−1 src/Data/IntMap/Refined.hs+2−1 src/Data/Map/Refined.hs+2−1
refined-containers.cabal+1−1
@@ -23,7 +23,7 @@ license: MIT
2323license-file: LICENSE
2424author: mniip@typeable.io
2525maintainer: mniip@typeable.io
26−version: 0.1.1.0
26+version: 0.1.2.0
2727build-type: Simple
2828
2929tested-with:
src/Data/HashMap/Common/Refined.hs+3−3
@@ -474,7 +474,7 @@ instance TraversableWithIndex (Key s k) (HashMap s k) where
474474 itraverse = traverseWithKey
475475
476476-- | Similar to the instance for functions -- zip corresponding keys. To use
477−-- '<*>'/'Control.Applicative.liftA2' without 'KnownSet' see 'zipWith'.
477+-- '<*>'/'Control.Applicative.liftA2' without 'KnownHashSet' see 'zipWith'.
478478instance (Hashable k, KnownHashSet s k) => Applicative (HashMap s k) where
479479 pure x = fromSet \_ -> x
480480 (<*>) = zipWith id
@@ -486,8 +486,8 @@ bind
486486 => HashMap s k a -> (a -> HashMap s k b) -> HashMap s k b
487487bind m f = mapWithKey (\k x -> f x ! k) m
488488
489−-- | Similar to the instance for functions. To use '>>=' without 'KnownSet' see
490−-- 'bind'.
489+-- | Similar to the instance for functions. To use '>>=' without 'KnownHashSet'
490+-- see 'bind'.
491491instance (Hashable k, KnownHashSet s k) => Monad (HashMap s k) where
492492 (>>=) = bind
493493
src/Data/HashMap/Refined.hs+2−1
@@ -344,7 +344,8 @@ updateLookupWithKey f k (HashMap m) =
344344 )
345345
346346-- | Given two maps proven to have the same keys, for each key apply the
347−-- function to the associated values, to obtain a new map with the same keys.
347+-- function to the associated values and the key, to obtain a new map with the
348+-- same keys.
348349zipWithKey
349350 :: forall s k a b c. Hashable k
350351 => (Key s k -> a -> b -> c) -> HashMap s k a -> HashMap s k b -> HashMap s k c
src/Data/IntMap/Refined.hs+2−1
@@ -337,7 +337,8 @@ updateLookupWithKey f k (IntMap m)
337337 $ SomeIntMapWith (IntMap m') $ SupersetProof unsafeSubset
338338
339339-- | Given two maps proven to have the same keys, for each key apply the
340−-- function to the associated values, to obtain a new map with the same keys.
340+-- function to the associated values and the key, to obtain a new map with the
341+-- same keys.
341342zipWithKey
342343 :: forall s a b c. (Key s -> a -> b -> c)
343344 -> IntMap s a
src/Data/Map/Refined.hs+2−1
@@ -348,7 +348,8 @@ updateLookupWithKey f k (Map m)
348348 $ SomeMapWith (Map m') $ SupersetProof unsafeSubset
349349
350350-- | Given two maps proven to have the same keys, for each key apply the
351−-- function to the associated values, to obtain a new map with the same keys.
351+-- function to the associated values and the key, to obtain a new map with the
352+-- same keys.
352353zipWithKey
353354 :: forall s k a b c. Ord k
354355 => (Key s k -> a -> b -> c) -> Map s k a -> Map s k b -> Map s k c