{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE TypeFamilies #-}
module Data.VMap
( VG.Vector,
VB,
VU,
VP,
VS,
VMap (..),
empty,
size,
lookup,
findWithDefault,
member,
notMember,
map,
mapMaybe,
mapWithKey,
filter,
fold,
foldl,
foldlWithKey,
foldMap,
foldMapWithKey,
fromMap,
toMap,
fromList,
fromListN,
toList,
toAscList,
keys,
elems,
fromAscList,
fromAscListN,
fromAscListWithKey,
fromAscListWithKeyN,
fromDistinctAscList,
fromDistinctAscListN,
internMaybe,
null,
splitAt,
KV.KVMVector,
KV.KVVector,
KV.normalize,
KV.normalizeM,
)
where
import Cardano.Binary
import Control.DeepSeq
import qualified Data.Map.Strict as Map
import Data.Maybe as Maybe hiding (mapMaybe)
import Data.VMap.KVVector (KVVector (..))
import qualified Data.VMap.KVVector as KV
import qualified Data.Vector as V
import qualified Data.Vector.Generic as VG
import qualified Data.Vector.Primitive as VP
import qualified Data.Vector.Storable as VS
import qualified Data.Vector.Storable as VU
import qualified GHC.Exts as Exts
import GHC.Generics (Generic)
import NoThunks.Class
import Prelude hiding (filter, foldMap, foldl, lookup, map, null, splitAt)
type VB = V.Vector
type VU = VU.Vector
type VP = VP.Vector
type VS = VS.Vector
newtype VMap kv vv k v = VMap
{ VMap kv vv k v -> KVVector kv vv (k, v)
unVMap :: KVVector kv vv (k, v)
}
deriving (VMap kv vv k v -> VMap kv vv k v -> Bool
(VMap kv vv k v -> VMap kv vv k v -> Bool)
-> (VMap kv vv k v -> VMap kv vv k v -> Bool)
-> Eq (VMap kv vv k v)
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
forall (kv :: * -> *) (vv :: * -> *) k v.
(Eq (kv k), Eq (vv v)) =>
VMap kv vv k v -> VMap kv vv k v -> Bool
/= :: VMap kv vv k v -> VMap kv vv k v -> Bool
$c/= :: forall (kv :: * -> *) (vv :: * -> *) k v.
(Eq (kv k), Eq (vv v)) =>
VMap kv vv k v -> VMap kv vv k v -> Bool
== :: VMap kv vv k v -> VMap kv vv k v -> Bool
$c== :: forall (kv :: * -> *) (vv :: * -> *) k v.
(Eq (kv k), Eq (vv v)) =>
VMap kv vv k v -> VMap kv vv k v -> Bool
Eq, (forall x. VMap kv vv k v -> Rep (VMap kv vv k v) x)
-> (forall x. Rep (VMap kv vv k v) x -> VMap kv vv k v)
-> Generic (VMap kv vv k v)
forall x. Rep (VMap kv vv k v) x -> VMap kv vv k v
forall x. VMap kv vv k v -> Rep (VMap kv vv k v) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall (kv :: * -> *) (vv :: * -> *) k v x.
Rep (VMap kv vv k v) x -> VMap kv vv k v
forall (kv :: * -> *) (vv :: * -> *) k v x.
VMap kv vv k v -> Rep (VMap kv vv k v) x
$cto :: forall (kv :: * -> *) (vv :: * -> *) k v x.
Rep (VMap kv vv k v) x -> VMap kv vv k v
$cfrom :: forall (kv :: * -> *) (vv :: * -> *) k v x.
VMap kv vv k v -> Rep (VMap kv vv k v) x
Generic, Context -> VMap kv vv k v -> IO (Maybe ThunkInfo)
Proxy (VMap kv vv k v) -> String
(Context -> VMap kv vv k v -> IO (Maybe ThunkInfo))
-> (Context -> VMap kv vv k v -> IO (Maybe ThunkInfo))
-> (Proxy (VMap kv vv k v) -> String)
-> NoThunks (VMap kv vv k v)
forall a.
(Context -> a -> IO (Maybe ThunkInfo))
-> (Context -> a -> IO (Maybe ThunkInfo))
-> (Proxy a -> String)
-> NoThunks a
forall (kv :: * -> *) (vv :: * -> *) k v.
(NoThunks (kv k), NoThunks (vv v), Typeable kv, Typeable vv,
Typeable k, Typeable v) =>
Context -> VMap kv vv k v -> IO (Maybe ThunkInfo)
forall (kv :: * -> *) (vv :: * -> *) k v.
(NoThunks (kv k), NoThunks (vv v), Typeable kv, Typeable vv,
Typeable k, Typeable v) =>
Proxy (VMap kv vv k v) -> String
showTypeOf :: Proxy (VMap kv vv k v) -> String
$cshowTypeOf :: forall (kv :: * -> *) (vv :: * -> *) k v.
(NoThunks (kv k), NoThunks (vv v), Typeable kv, Typeable vv,
Typeable k, Typeable v) =>
Proxy (VMap kv vv k v) -> String
wNoThunks :: Context -> VMap kv vv k v -> IO (Maybe ThunkInfo)
$cwNoThunks :: forall (kv :: * -> *) (vv :: * -> *) k v.
(NoThunks (kv k), NoThunks (vv v), Typeable kv, Typeable vv,
Typeable k, Typeable v) =>
Context -> VMap kv vv k v -> IO (Maybe ThunkInfo)
noThunks :: Context -> VMap kv vv k v -> IO (Maybe ThunkInfo)
$cnoThunks :: forall (kv :: * -> *) (vv :: * -> *) k v.
(NoThunks (kv k), NoThunks (vv v), Typeable kv, Typeable vv,
Typeable k, Typeable v) =>
Context -> VMap kv vv k v -> IO (Maybe ThunkInfo)
NoThunks, Typeable (VMap kv vv k v)
Typeable (VMap kv vv k v)
-> (VMap kv vv k v -> Encoding)
-> ((forall t. ToCBOR t => Proxy t -> Size)
-> Proxy (VMap kv vv k v) -> Size)
-> ((forall t. ToCBOR t => Proxy t -> Size)
-> Proxy [VMap kv vv k v] -> Size)
-> ToCBOR (VMap kv vv k v)
VMap kv vv k v -> Encoding
(forall t. ToCBOR t => Proxy t -> Size)
-> Proxy [VMap kv vv k v] -> Size
(forall t. ToCBOR t => Proxy t -> Size)
-> Proxy (VMap kv vv k v) -> Size
forall a.
Typeable a
-> (a -> Encoding)
-> ((forall t. ToCBOR t => Proxy t -> Size) -> Proxy a -> Size)
-> ((forall t. ToCBOR t => Proxy t -> Size) -> Proxy [a] -> Size)
-> ToCBOR a
forall (kv :: * -> *) (vv :: * -> *) k v.
(Typeable kv, Typeable vv, ToCBOR k, ToCBOR v, Ord k, Vector kv k,
Vector vv v) =>
Typeable (VMap kv vv k v)
forall (kv :: * -> *) (vv :: * -> *) k v.
(Typeable kv, Typeable vv, ToCBOR k, ToCBOR v, Ord k, Vector kv k,
Vector vv v) =>
VMap kv vv k v -> Encoding
forall (kv :: * -> *) (vv :: * -> *) k v.
(Typeable kv, Typeable vv, ToCBOR k, ToCBOR v, Ord k, Vector kv k,
Vector vv v) =>
(forall t. ToCBOR t => Proxy t -> Size)
-> Proxy [VMap kv vv k v] -> Size
forall (kv :: * -> *) (vv :: * -> *) k v.
(Typeable kv, Typeable vv, ToCBOR k, ToCBOR v, Ord k, Vector kv k,
Vector vv v) =>
(forall t. ToCBOR t => Proxy t -> Size)
-> Proxy (VMap kv vv k v) -> Size
encodedListSizeExpr :: (forall t. ToCBOR t => Proxy t -> Size)
-> Proxy [VMap kv vv k v] -> Size
$cencodedListSizeExpr :: forall (kv :: * -> *) (vv :: * -> *) k v.
(Typeable kv, Typeable vv, ToCBOR k, ToCBOR v, Ord k, Vector kv k,
Vector vv v) =>
(forall t. ToCBOR t => Proxy t -> Size)
-> Proxy [VMap kv vv k v] -> Size
encodedSizeExpr :: (forall t. ToCBOR t => Proxy t -> Size)
-> Proxy (VMap kv vv k v) -> Size
$cencodedSizeExpr :: forall (kv :: * -> *) (vv :: * -> *) k v.
(Typeable kv, Typeable vv, ToCBOR k, ToCBOR v, Ord k, Vector kv k,
Vector vv v) =>
(forall t. ToCBOR t => Proxy t -> Size)
-> Proxy (VMap kv vv k v) -> Size
toCBOR :: VMap kv vv k v -> Encoding
$ctoCBOR :: forall (kv :: * -> *) (vv :: * -> *) k v.
(Typeable kv, Typeable vv, ToCBOR k, ToCBOR v, Ord k, Vector kv k,
Vector vv v) =>
VMap kv vv k v -> Encoding
$cp1ToCBOR :: forall (kv :: * -> *) (vv :: * -> *) k v.
(Typeable kv, Typeable vv, ToCBOR k, ToCBOR v, Ord k, Vector kv k,
Vector vv v) =>
Typeable (VMap kv vv k v)
ToCBOR, Typeable (VMap kv vv k v)
Decoder s (VMap kv vv k v)
Typeable (VMap kv vv k v)
-> (forall s. Decoder s (VMap kv vv k v))
-> (Proxy (VMap kv vv k v) -> Text)
-> FromCBOR (VMap kv vv k v)
Proxy (VMap kv vv k v) -> Text
forall s. Decoder s (VMap kv vv k v)
forall a.
Typeable a
-> (forall s. Decoder s a) -> (Proxy a -> Text) -> FromCBOR a
forall (kv :: * -> *) (vv :: * -> *) k v.
(Typeable kv, Typeable vv, FromCBOR k, FromCBOR v, Ord k,
Vector kv k, Vector vv v) =>
Typeable (VMap kv vv k v)
forall (kv :: * -> *) (vv :: * -> *) k v.
(Typeable kv, Typeable vv, FromCBOR k, FromCBOR v, Ord k,
Vector kv k, Vector vv v) =>
Proxy (VMap kv vv k v) -> Text
forall (kv :: * -> *) (vv :: * -> *) k v s.
(Typeable kv, Typeable vv, FromCBOR k, FromCBOR v, Ord k,
Vector kv k, Vector vv v) =>
Decoder s (VMap kv vv k v)
label :: Proxy (VMap kv vv k v) -> Text
$clabel :: forall (kv :: * -> *) (vv :: * -> *) k v.
(Typeable kv, Typeable vv, FromCBOR k, FromCBOR v, Ord k,
Vector kv k, Vector vv v) =>
Proxy (VMap kv vv k v) -> Text
fromCBOR :: Decoder s (VMap kv vv k v)
$cfromCBOR :: forall (kv :: * -> *) (vv :: * -> *) k v s.
(Typeable kv, Typeable vv, FromCBOR k, FromCBOR v, Ord k,
Vector kv k, Vector vv v) =>
Decoder s (VMap kv vv k v)
$cp1FromCBOR :: forall (kv :: * -> *) (vv :: * -> *) k v.
(Typeable kv, Typeable vv, FromCBOR k, FromCBOR v, Ord k,
Vector kv k, Vector vv v) =>
Typeable (VMap kv vv k v)
FromCBOR, VMap kv vv k v -> ()
(VMap kv vv k v -> ()) -> NFData (VMap kv vv k v)
forall a. (a -> ()) -> NFData a
forall (kv :: * -> *) (vv :: * -> *) k v.
(NFData (kv k), NFData (vv v)) =>
VMap kv vv k v -> ()
rnf :: VMap kv vv k v -> ()
$crnf :: forall (kv :: * -> *) (vv :: * -> *) k v.
(NFData (kv k), NFData (vv v)) =>
VMap kv vv k v -> ()
NFData, b -> VMap kv vv k v -> VMap kv vv k v
NonEmpty (VMap kv vv k v) -> VMap kv vv k v
VMap kv vv k v -> VMap kv vv k v -> VMap kv vv k v
(VMap kv vv k v -> VMap kv vv k v -> VMap kv vv k v)
-> (NonEmpty (VMap kv vv k v) -> VMap kv vv k v)
-> (forall b. Integral b => b -> VMap kv vv k v -> VMap kv vv k v)
-> Semigroup (VMap kv vv k v)
forall b. Integral b => b -> VMap kv vv k v -> VMap kv vv k v
forall a.
(a -> a -> a)
-> (NonEmpty a -> a)
-> (forall b. Integral b => b -> a -> a)
-> Semigroup a
forall (kv :: * -> *) (vv :: * -> *) k v.
(Vector kv k, Vector vv v, Ord k) =>
NonEmpty (VMap kv vv k v) -> VMap kv vv k v
forall (kv :: * -> *) (vv :: * -> *) k v.
(Vector kv k, Vector vv v, Ord k) =>
VMap kv vv k v -> VMap kv vv k v -> VMap kv vv k v
forall (kv :: * -> *) (vv :: * -> *) k v b.
(Vector kv k, Vector vv v, Ord k, Integral b) =>
b -> VMap kv vv k v -> VMap kv vv k v
stimes :: b -> VMap kv vv k v -> VMap kv vv k v
$cstimes :: forall (kv :: * -> *) (vv :: * -> *) k v b.
(Vector kv k, Vector vv v, Ord k, Integral b) =>
b -> VMap kv vv k v -> VMap kv vv k v
sconcat :: NonEmpty (VMap kv vv k v) -> VMap kv vv k v
$csconcat :: forall (kv :: * -> *) (vv :: * -> *) k v.
(Vector kv k, Vector vv v, Ord k) =>
NonEmpty (VMap kv vv k v) -> VMap kv vv k v
<> :: VMap kv vv k v -> VMap kv vv k v -> VMap kv vv k v
$c<> :: forall (kv :: * -> *) (vv :: * -> *) k v.
(Vector kv k, Vector vv v, Ord k) =>
VMap kv vv k v -> VMap kv vv k v -> VMap kv vv k v
Semigroup, Semigroup (VMap kv vv k v)
VMap kv vv k v
Semigroup (VMap kv vv k v)
-> VMap kv vv k v
-> (VMap kv vv k v -> VMap kv vv k v -> VMap kv vv k v)
-> ([VMap kv vv k v] -> VMap kv vv k v)
-> Monoid (VMap kv vv k v)
[VMap kv vv k v] -> VMap kv vv k v
VMap kv vv k v -> VMap kv vv k v -> VMap kv vv k v
forall a.
Semigroup a -> a -> (a -> a -> a) -> ([a] -> a) -> Monoid a
forall (kv :: * -> *) (vv :: * -> *) k v.
(Vector kv k, Vector vv v, Ord k) =>
Semigroup (VMap kv vv k v)
forall (kv :: * -> *) (vv :: * -> *) k v.
(Vector kv k, Vector vv v, Ord k) =>
VMap kv vv k v
forall (kv :: * -> *) (vv :: * -> *) k v.
(Vector kv k, Vector vv v, Ord k) =>
[VMap kv vv k v] -> VMap kv vv k v
forall (kv :: * -> *) (vv :: * -> *) k v.
(Vector kv k, Vector vv v, Ord k) =>
VMap kv vv k v -> VMap kv vv k v -> VMap kv vv k v
mconcat :: [VMap kv vv k v] -> VMap kv vv k v
$cmconcat :: forall (kv :: * -> *) (vv :: * -> *) k v.
(Vector kv k, Vector vv v, Ord k) =>
[VMap kv vv k v] -> VMap kv vv k v
mappend :: VMap kv vv k v -> VMap kv vv k v -> VMap kv vv k v
$cmappend :: forall (kv :: * -> *) (vv :: * -> *) k v.
(Vector kv k, Vector vv v, Ord k) =>
VMap kv vv k v -> VMap kv vv k v -> VMap kv vv k v
mempty :: VMap kv vv k v
$cmempty :: forall (kv :: * -> *) (vv :: * -> *) k v.
(Vector kv k, Vector vv v, Ord k) =>
VMap kv vv k v
$cp1Monoid :: forall (kv :: * -> *) (vv :: * -> *) k v.
(Vector kv k, Vector vv v, Ord k) =>
Semigroup (VMap kv vv k v)
Monoid)
instance (Show k, Show v, VG.Vector kv k, VG.Vector vv v) => Show (VMap kv vv k v) where
show :: VMap kv vv k v -> String
show = Map k v -> String
forall a. Show a => a -> String
show (Map k v -> String)
-> (VMap kv vv k v -> Map k v) -> VMap kv vv k v -> String
forall b c a. (b -> c) -> (a -> b) -> a -> c
. KVVector kv vv (k, v) -> Map k v
forall (kv :: * -> *) k (vv :: * -> *) v.
(Vector kv k, Vector vv v) =>
KVVector kv vv (k, v) -> Map k v
KV.toMap (KVVector kv vv (k, v) -> Map k v)
-> (VMap kv vv k v -> KVVector kv vv (k, v))
-> VMap kv vv k v
-> Map k v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. VMap kv vv k v -> KVVector kv vv (k, v)
forall (kv :: * -> *) (vv :: * -> *) k v.
VMap kv vv k v -> KVVector kv vv (k, v)
unVMap
instance (VG.Vector kv k, VG.Vector vv v, Ord k) => Exts.IsList (VMap kv vv k v) where
type Item (VMap kv vv k v) = (k, v)
fromList :: [Item (VMap kv vv k v)] -> VMap kv vv k v
fromList = [Item (VMap kv vv k v)] -> VMap kv vv k v
forall k (kv :: * -> *) (vv :: * -> *) v.
(Ord k, Vector kv k, Vector vv v) =>
[(k, v)] -> VMap kv vv k v
fromList
{-# INLINE fromList #-}
fromListN :: Int -> [Item (VMap kv vv k v)] -> VMap kv vv k v
fromListN = Int -> [Item (VMap kv vv k v)] -> VMap kv vv k v
forall k (kv :: * -> *) (vv :: * -> *) v.
(Ord k, Vector kv k, Vector vv v) =>
Int -> [(k, v)] -> VMap kv vv k v
fromListN
{-# INLINE fromListN #-}
toList :: VMap kv vv k v -> [Item (VMap kv vv k v)]
toList = VMap kv vv k v -> [Item (VMap kv vv k v)]
forall (kv :: * -> *) k (vv :: * -> *) v.
(Vector kv k, Vector vv v) =>
VMap kv vv k v -> [(k, v)]
toAscList
{-# INLINE toList #-}
empty :: (VG.Vector kv k, VG.Vector vv v) => VMap kv vv k v
empty :: VMap kv vv k v
empty = KVVector kv vv (k, v) -> VMap kv vv k v
forall (kv :: * -> *) (vv :: * -> *) k v.
KVVector kv vv (k, v) -> VMap kv vv k v
VMap KVVector kv vv (k, v)
forall (v :: * -> *) a. Vector v a => v a
VG.empty
size :: (VG.Vector kv k) => VMap kv vv k v -> Int
size :: VMap kv vv k v -> Int
size = kv k -> Int
forall (v :: * -> *) a. Vector v a => v a -> Int
VG.length (kv k -> Int) -> (VMap kv vv k v -> kv k) -> VMap kv vv k v -> Int
forall b c a. (b -> c) -> (a -> b) -> a -> c
. KVVector kv vv (k, v) -> kv k
forall (kv :: * -> *) (vv :: * -> *) a.
KVVector kv vv a -> kv (Key a)
KV.keysVector (KVVector kv vv (k, v) -> kv k)
-> (VMap kv vv k v -> KVVector kv vv (k, v))
-> VMap kv vv k v
-> kv k
forall b c a. (b -> c) -> (a -> b) -> a -> c
. VMap kv vv k v -> KVVector kv vv (k, v)
forall (kv :: * -> *) (vv :: * -> *) k v.
VMap kv vv k v -> KVVector kv vv (k, v)
unVMap
{-# INLINE size #-}
lookup ::
(Ord k, VG.Vector kv k, VG.Vector vv v) => k -> VMap kv vv k v -> Maybe v
lookup :: k -> VMap kv vv k v -> Maybe v
lookup k
k = k -> KVVector kv vv (k, v) -> Maybe v
forall k (kv :: * -> *) (vv :: * -> *) v.
(Ord k, Vector kv k, Vector vv v) =>
k -> KVVector kv vv (k, v) -> Maybe v
KV.lookupKVVector k
k (KVVector kv vv (k, v) -> Maybe v)
-> (VMap kv vv k v -> KVVector kv vv (k, v))
-> VMap kv vv k v
-> Maybe v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. VMap kv vv k v -> KVVector kv vv (k, v)
forall (kv :: * -> *) (vv :: * -> *) k v.
VMap kv vv k v -> KVVector kv vv (k, v)
unVMap
{-# INLINE lookup #-}
member ::
(Ord k, VG.Vector kv k) => k -> VMap kv vv k v -> Bool
member :: k -> VMap kv vv k v -> Bool
member k
k = k -> KVVector kv vv (k, v) -> Bool
forall k (kv :: * -> *) (vv :: * -> *) v.
(Ord k, Vector kv k) =>
k -> KVVector kv vv (k, v) -> Bool
KV.memberKVVector k
k (KVVector kv vv (k, v) -> Bool)
-> (VMap kv vv k v -> KVVector kv vv (k, v))
-> VMap kv vv k v
-> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. VMap kv vv k v -> KVVector kv vv (k, v)
forall (kv :: * -> *) (vv :: * -> *) k v.
VMap kv vv k v -> KVVector kv vv (k, v)
unVMap
{-# INLINE member #-}
notMember ::
(Ord k, VG.Vector kv k) => k -> VMap kv vv k v -> Bool
notMember :: k -> VMap kv vv k v -> Bool
notMember k
k = Bool -> Bool
not (Bool -> Bool)
-> (VMap kv vv k v -> Bool) -> VMap kv vv k v -> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. k -> VMap kv vv k v -> Bool
forall k (kv :: * -> *) (vv :: * -> *) v.
(Ord k, Vector kv k) =>
k -> VMap kv vv k v -> Bool
member k
k
{-# INLINE notMember #-}
filter ::
(VG.Vector kv k, VG.Vector vv v) =>
(k -> v -> Bool) ->
VMap kv vv k v ->
VMap kv vv k v
filter :: (k -> v -> Bool) -> VMap kv vv k v -> VMap kv vv k v
filter k -> v -> Bool
f = KVVector kv vv (k, v) -> VMap kv vv k v
forall (kv :: * -> *) (vv :: * -> *) k v.
KVVector kv vv (k, v) -> VMap kv vv k v
VMap (KVVector kv vv (k, v) -> VMap kv vv k v)
-> (VMap kv vv k v -> KVVector kv vv (k, v))
-> VMap kv vv k v
-> VMap kv vv k v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((k, v) -> Bool) -> KVVector kv vv (k, v) -> KVVector kv vv (k, v)
forall (v :: * -> *) a. Vector v a => (a -> Bool) -> v a -> v a
VG.filter ((k -> v -> Bool) -> (k, v) -> Bool
forall a b c. (a -> b -> c) -> (a, b) -> c
uncurry k -> v -> Bool
f) (KVVector kv vv (k, v) -> KVVector kv vv (k, v))
-> (VMap kv vv k v -> KVVector kv vv (k, v))
-> VMap kv vv k v
-> KVVector kv vv (k, v)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. VMap kv vv k v -> KVVector kv vv (k, v)
forall (kv :: * -> *) (vv :: * -> *) k v.
VMap kv vv k v -> KVVector kv vv (k, v)
unVMap
{-# INLINE filter #-}
findWithDefault ::
(Ord k, VG.Vector kv k, VG.Vector vv v) => v -> k -> VMap kv vv k v -> v
findWithDefault :: v -> k -> VMap kv vv k v -> v
findWithDefault v
a k
k = v -> Maybe v -> v
forall a. a -> Maybe a -> a
fromMaybe v
a (Maybe v -> v)
-> (VMap kv vv k v -> Maybe v) -> VMap kv vv k v -> v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. k -> VMap kv vv k v -> Maybe v
forall k (kv :: * -> *) (vv :: * -> *) v.
(Ord k, Vector kv k, Vector vv v) =>
k -> VMap kv vv k v -> Maybe v
lookup k
k
{-# INLINE findWithDefault #-}
fromMap :: (VG.Vector kv k, VG.Vector vv v) => Map.Map k v -> VMap kv vv k v
fromMap :: Map k v -> VMap kv vv k v
fromMap = KVVector kv vv (k, v) -> VMap kv vv k v
forall (kv :: * -> *) (vv :: * -> *) k v.
KVVector kv vv (k, v) -> VMap kv vv k v
VMap (KVVector kv vv (k, v) -> VMap kv vv k v)
-> (Map k v -> KVVector kv vv (k, v)) -> Map k v -> VMap kv vv k v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Map k v -> KVVector kv vv (k, v)
forall (kv :: * -> *) k (vv :: * -> *) v.
(Vector kv k, Vector vv v) =>
Map k v -> KVVector kv vv (k, v)
KV.fromMap
{-# INLINE fromMap #-}
toMap :: (VG.Vector kv k, VG.Vector vv v) => VMap kv vv k v -> Map.Map k v
toMap :: VMap kv vv k v -> Map k v
toMap = KVVector kv vv (k, v) -> Map k v
forall (kv :: * -> *) k (vv :: * -> *) v.
(Vector kv k, Vector vv v) =>
KVVector kv vv (k, v) -> Map k v
KV.toMap (KVVector kv vv (k, v) -> Map k v)
-> (VMap kv vv k v -> KVVector kv vv (k, v))
-> VMap kv vv k v
-> Map k v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. VMap kv vv k v -> KVVector kv vv (k, v)
forall (kv :: * -> *) (vv :: * -> *) k v.
VMap kv vv k v -> KVVector kv vv (k, v)
unVMap
{-# INLINE toMap #-}
toList :: (VG.Vector kv k, VG.Vector vv v) => VMap kv vv k v -> [(k, v)]
toList :: VMap kv vv k v -> [(k, v)]
toList = KVVector kv vv (k, v) -> [(k, v)]
forall (v :: * -> *) a. Vector v a => v a -> [a]
VG.toList (KVVector kv vv (k, v) -> [(k, v)])
-> (VMap kv vv k v -> KVVector kv vv (k, v))
-> VMap kv vv k v
-> [(k, v)]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. VMap kv vv k v -> KVVector kv vv (k, v)
forall (kv :: * -> *) (vv :: * -> *) k v.
VMap kv vv k v -> KVVector kv vv (k, v)
unVMap
{-# INLINE toList #-}
toAscList :: (VG.Vector kv k, VG.Vector vv v) => VMap kv vv k v -> [(k, v)]
toAscList :: VMap kv vv k v -> [(k, v)]
toAscList = KVVector kv vv (k, v) -> [(k, v)]
forall (v :: * -> *) a. Vector v a => v a -> [a]
VG.toList (KVVector kv vv (k, v) -> [(k, v)])
-> (VMap kv vv k v -> KVVector kv vv (k, v))
-> VMap kv vv k v
-> [(k, v)]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. VMap kv vv k v -> KVVector kv vv (k, v)
forall (kv :: * -> *) (vv :: * -> *) k v.
VMap kv vv k v -> KVVector kv vv (k, v)
unVMap
{-# INLINE toAscList #-}
fromList ::
(Ord k, VG.Vector kv k, VG.Vector vv v) => [(k, v)] -> VMap kv vv k v
fromList :: [(k, v)] -> VMap kv vv k v
fromList = KVVector kv vv (k, v) -> VMap kv vv k v
forall (kv :: * -> *) (vv :: * -> *) k v.
KVVector kv vv (k, v) -> VMap kv vv k v
VMap (KVVector kv vv (k, v) -> VMap kv vv k v)
-> ([(k, v)] -> KVVector kv vv (k, v))
-> [(k, v)]
-> VMap kv vv k v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [(k, v)] -> KVVector kv vv (k, v)
forall (kv :: * -> *) k (vv :: * -> *) v.
(Vector kv k, Vector vv v, Ord k) =>
[(k, v)] -> KVVector kv vv (k, v)
KV.fromList
{-# INLINE fromList #-}
fromListN ::
(Ord k, VG.Vector kv k, VG.Vector vv v) => Int -> [(k, v)] -> VMap kv vv k v
fromListN :: Int -> [(k, v)] -> VMap kv vv k v
fromListN Int
n = KVVector kv vv (k, v) -> VMap kv vv k v
forall (kv :: * -> *) (vv :: * -> *) k v.
KVVector kv vv (k, v) -> VMap kv vv k v
VMap (KVVector kv vv (k, v) -> VMap kv vv k v)
-> ([(k, v)] -> KVVector kv vv (k, v))
-> [(k, v)]
-> VMap kv vv k v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Int -> [(k, v)] -> KVVector kv vv (k, v)
forall (kv :: * -> *) k (vv :: * -> *) v.
(Vector kv k, Vector vv v, Ord k) =>
Int -> [(k, v)] -> KVVector kv vv (k, v)
KV.fromListN Int
n
{-# INLINE fromListN #-}
fromAscList ::
(Eq k, VG.Vector kv k, VG.Vector vv v) => [(k, v)] -> VMap kv vv k v
fromAscList :: [(k, v)] -> VMap kv vv k v
fromAscList = KVVector kv vv (k, v) -> VMap kv vv k v
forall (kv :: * -> *) (vv :: * -> *) k v.
KVVector kv vv (k, v) -> VMap kv vv k v
VMap (KVVector kv vv (k, v) -> VMap kv vv k v)
-> ([(k, v)] -> KVVector kv vv (k, v))
-> [(k, v)]
-> VMap kv vv k v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [(k, v)] -> KVVector kv vv (k, v)
forall k (kv :: * -> *) (vv :: * -> *) v.
(Eq k, Vector kv k, Vector vv v) =>
[(k, v)] -> KVVector kv vv (k, v)
KV.fromAscList
{-# INLINE fromAscList #-}
fromAscListN ::
(Eq k, VG.Vector kv k, VG.Vector vv v) => Int -> [(k, v)] -> VMap kv vv k v
fromAscListN :: Int -> [(k, v)] -> VMap kv vv k v
fromAscListN Int
n = KVVector kv vv (k, v) -> VMap kv vv k v
forall (kv :: * -> *) (vv :: * -> *) k v.
KVVector kv vv (k, v) -> VMap kv vv k v
VMap (KVVector kv vv (k, v) -> VMap kv vv k v)
-> ([(k, v)] -> KVVector kv vv (k, v))
-> [(k, v)]
-> VMap kv vv k v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Int -> [(k, v)] -> KVVector kv vv (k, v)
forall k (kv :: * -> *) (vv :: * -> *) v.
(Eq k, Vector kv k, Vector vv v) =>
Int -> [(k, v)] -> KVVector kv vv (k, v)
KV.fromAscListN Int
n
{-# INLINE fromAscListN #-}
fromAscListWithKey ::
(Eq k, VG.Vector kv k, VG.Vector vv v) => (k -> v -> v -> v) -> [(k, v)] -> VMap kv vv k v
fromAscListWithKey :: (k -> v -> v -> v) -> [(k, v)] -> VMap kv vv k v
fromAscListWithKey k -> v -> v -> v
f = KVVector kv vv (k, v) -> VMap kv vv k v
forall (kv :: * -> *) (vv :: * -> *) k v.
KVVector kv vv (k, v) -> VMap kv vv k v
VMap (KVVector kv vv (k, v) -> VMap kv vv k v)
-> ([(k, v)] -> KVVector kv vv (k, v))
-> [(k, v)]
-> VMap kv vv k v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (k -> v -> v -> v) -> [(k, v)] -> KVVector kv vv (k, v)
forall k (kv :: * -> *) (vv :: * -> *) v.
(Eq k, Vector kv k, Vector vv v) =>
(k -> v -> v -> v) -> [(k, v)] -> KVVector kv vv (k, v)
KV.fromAscListWithKey k -> v -> v -> v
f
{-# INLINE fromAscListWithKey #-}
fromAscListWithKeyN ::
(Eq k, VG.Vector kv k, VG.Vector vv v) => Int -> (k -> v -> v -> v) -> [(k, v)] -> VMap kv vv k v
fromAscListWithKeyN :: Int -> (k -> v -> v -> v) -> [(k, v)] -> VMap kv vv k v
fromAscListWithKeyN Int
n k -> v -> v -> v
f = KVVector kv vv (k, v) -> VMap kv vv k v
forall (kv :: * -> *) (vv :: * -> *) k v.
KVVector kv vv (k, v) -> VMap kv vv k v
VMap (KVVector kv vv (k, v) -> VMap kv vv k v)
-> ([(k, v)] -> KVVector kv vv (k, v))
-> [(k, v)]
-> VMap kv vv k v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Int -> (k -> v -> v -> v) -> [(k, v)] -> KVVector kv vv (k, v)
forall k (kv :: * -> *) (vv :: * -> *) v.
(Eq k, Vector kv k, Vector vv v) =>
Int -> (k -> v -> v -> v) -> [(k, v)] -> KVVector kv vv (k, v)
KV.fromAscListWithKeyN Int
n k -> v -> v -> v
f
{-# INLINE fromAscListWithKeyN #-}
fromDistinctAscList ::
(VG.Vector kv k, VG.Vector vv v) => [(k, v)] -> VMap kv vv k v
fromDistinctAscList :: [(k, v)] -> VMap kv vv k v
fromDistinctAscList = KVVector kv vv (k, v) -> VMap kv vv k v
forall (kv :: * -> *) (vv :: * -> *) k v.
KVVector kv vv (k, v) -> VMap kv vv k v
VMap (KVVector kv vv (k, v) -> VMap kv vv k v)
-> ([(k, v)] -> KVVector kv vv (k, v))
-> [(k, v)]
-> VMap kv vv k v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [(k, v)] -> KVVector kv vv (k, v)
forall (kv :: * -> *) k (vv :: * -> *) v.
(Vector kv k, Vector vv v) =>
[(k, v)] -> KVVector kv vv (k, v)
KV.fromDistinctAscList
{-# INLINE fromDistinctAscList #-}
fromDistinctAscListN ::
(VG.Vector kv k, VG.Vector vv v) => Int -> [(k, v)] -> VMap kv vv k v
fromDistinctAscListN :: Int -> [(k, v)] -> VMap kv vv k v
fromDistinctAscListN Int
n = KVVector kv vv (k, v) -> VMap kv vv k v
forall (kv :: * -> *) (vv :: * -> *) k v.
KVVector kv vv (k, v) -> VMap kv vv k v
VMap (KVVector kv vv (k, v) -> VMap kv vv k v)
-> ([(k, v)] -> KVVector kv vv (k, v))
-> [(k, v)]
-> VMap kv vv k v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Int -> [(k, v)] -> KVVector kv vv (k, v)
forall (kv :: * -> *) k (vv :: * -> *) v.
(Vector kv k, Vector vv v) =>
Int -> [(k, v)] -> KVVector kv vv (k, v)
KV.fromDistinctAscListN Int
n
{-# INLINE fromDistinctAscListN #-}
map ::
(VG.Vector vv a, VG.Vector vv b) =>
(a -> b) ->
VMap kv vv k a ->
VMap kv vv k b
map :: (a -> b) -> VMap kv vv k a -> VMap kv vv k b
map a -> b
f (VMap KVVector kv vv (k, a)
vec) = KVVector kv vv (k, b) -> VMap kv vv k b
forall (kv :: * -> *) (vv :: * -> *) k v.
KVVector kv vv (k, v) -> VMap kv vv k v
VMap ((a -> b) -> KVVector kv vv (k, a) -> KVVector kv vv (k, b)
forall (vv :: * -> *) a b (kv :: * -> *) k.
(Vector vv a, Vector vv b) =>
(a -> b) -> KVVector kv vv (k, a) -> KVVector kv vv (k, b)
KV.mapValsKVVector a -> b
f KVVector kv vv (k, a)
vec)
{-# INLINE map #-}
mapMaybe ::
(VG.Vector kv k, VG.Vector vv a, VG.Vector vv b) =>
(a -> Maybe b) ->
VMap kv vv k a ->
VMap kv vv k b
mapMaybe :: (a -> Maybe b) -> VMap kv vv k a -> VMap kv vv k b
mapMaybe a -> Maybe b
f (VMap KVVector kv vv (k, a)
vec) = KVVector kv vv (k, b) -> VMap kv vv k b
forall (kv :: * -> *) (vv :: * -> *) k v.
KVVector kv vv (k, v) -> VMap kv vv k v
VMap (((k, a) -> Maybe (k, b))
-> KVVector kv vv (k, a) -> KVVector kv vv (k, b)
forall (v :: * -> *) a b.
(Vector v a, Vector v b) =>
(a -> Maybe b) -> v a -> v b
VG.mapMaybe (\(k
k, a
x) -> (,) k
k (b -> (k, b)) -> Maybe b -> Maybe (k, b)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> a -> Maybe b
f a
x) KVVector kv vv (k, a)
vec)
{-# INLINE mapMaybe #-}
mapWithKey ::
(VG.Vector kv k, VG.Vector vv a, VG.Vector vv b) =>
(k -> a -> b) ->
VMap kv vv k a ->
VMap kv vv k b
mapWithKey :: (k -> a -> b) -> VMap kv vv k a -> VMap kv vv k b
mapWithKey k -> a -> b
f (VMap KVVector kv vv (k, a)
vec) = KVVector kv vv (k, b) -> VMap kv vv k b
forall (kv :: * -> *) (vv :: * -> *) k v.
KVVector kv vv (k, v) -> VMap kv vv k v
VMap ((k -> a -> b) -> KVVector kv vv (k, a) -> KVVector kv vv (k, b)
forall (kv :: * -> *) k (vv :: * -> *) a b.
(Vector kv k, Vector vv a, Vector vv b) =>
(k -> a -> b) -> KVVector kv vv (k, a) -> KVVector kv vv (k, b)
KV.mapWithKeyKVVector k -> a -> b
f KVVector kv vv (k, a)
vec)
{-# INLINE mapWithKey #-}
foldMapWithKey ::
(VG.Vector kv k, VG.Vector vv v, Monoid m) =>
(k -> v -> m) ->
VMap kv vv k v ->
m
foldMapWithKey :: (k -> v -> m) -> VMap kv vv k v -> m
foldMapWithKey k -> v -> m
f = ((k, v) -> m) -> KVVector kv vv (k, v) -> m
forall m (v :: * -> *) a.
(Monoid m, Vector v a) =>
(a -> m) -> v a -> m
VG.foldMap' ((k -> v -> m) -> (k, v) -> m
forall a b c. (a -> b -> c) -> (a, b) -> c
uncurry k -> v -> m
f) (KVVector kv vv (k, v) -> m)
-> (VMap kv vv k v -> KVVector kv vv (k, v)) -> VMap kv vv k v -> m
forall b c a. (b -> c) -> (a -> b) -> a -> c
. VMap kv vv k v -> KVVector kv vv (k, v)
forall (kv :: * -> *) (vv :: * -> *) k v.
VMap kv vv k v -> KVVector kv vv (k, v)
unVMap
{-# INLINE foldMapWithKey #-}
foldl ::
VG.Vector vv v =>
(a -> v -> a) ->
a ->
VMap kv vv k v ->
a
foldl :: (a -> v -> a) -> a -> VMap kv vv k v -> a
foldl a -> v -> a
f a
a = (a -> v -> a) -> a -> vv v -> a
forall (v :: * -> *) b a.
Vector v b =>
(a -> b -> a) -> a -> v b -> a
VG.foldl' a -> v -> a
f a
a (vv v -> a) -> (VMap kv vv k v -> vv v) -> VMap kv vv k v -> a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. KVVector kv vv (k, v) -> vv v
forall (kv :: * -> *) (vv :: * -> *) a.
KVVector kv vv a -> vv (Value a)
valsVector (KVVector kv vv (k, v) -> vv v)
-> (VMap kv vv k v -> KVVector kv vv (k, v))
-> VMap kv vv k v
-> vv v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. VMap kv vv k v -> KVVector kv vv (k, v)
forall (kv :: * -> *) (vv :: * -> *) k v.
VMap kv vv k v -> KVVector kv vv (k, v)
unVMap
{-# INLINE foldl #-}
foldlWithKey ::
(VG.Vector kv k, VG.Vector vv v) =>
(a -> k -> v -> a) ->
a ->
VMap kv vv k v ->
a
foldlWithKey :: (a -> k -> v -> a) -> a -> VMap kv vv k v -> a
foldlWithKey a -> k -> v -> a
f a
a = (a -> (k, v) -> a) -> a -> KVVector kv vv (k, v) -> a
forall (v :: * -> *) b a.
Vector v b =>
(a -> b -> a) -> a -> v b -> a
VG.foldl' ((k -> v -> a) -> (k, v) -> a
forall a b c. (a -> b -> c) -> (a, b) -> c
uncurry ((k -> v -> a) -> (k, v) -> a)
-> (a -> k -> v -> a) -> a -> (k, v) -> a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. a -> k -> v -> a
f) a
a (KVVector kv vv (k, v) -> a)
-> (VMap kv vv k v -> KVVector kv vv (k, v)) -> VMap kv vv k v -> a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. VMap kv vv k v -> KVVector kv vv (k, v)
forall (kv :: * -> *) (vv :: * -> *) k v.
VMap kv vv k v -> KVVector kv vv (k, v)
unVMap
{-# INLINE foldlWithKey #-}
foldMap :: (VG.Vector vv v, Monoid m) => (v -> m) -> VMap kv vv k v -> m
foldMap :: (v -> m) -> VMap kv vv k v -> m
foldMap v -> m
f = (v -> m) -> vv v -> m
forall m (v :: * -> *) a.
(Monoid m, Vector v a) =>
(a -> m) -> v a -> m
VG.foldMap' v -> m
f (vv v -> m) -> (VMap kv vv k v -> vv v) -> VMap kv vv k v -> m
forall b c a. (b -> c) -> (a -> b) -> a -> c
. KVVector kv vv (k, v) -> vv v
forall (kv :: * -> *) (vv :: * -> *) a.
KVVector kv vv a -> vv (Value a)
valsVector (KVVector kv vv (k, v) -> vv v)
-> (VMap kv vv k v -> KVVector kv vv (k, v))
-> VMap kv vv k v
-> vv v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. VMap kv vv k v -> KVVector kv vv (k, v)
forall (kv :: * -> *) (vv :: * -> *) k v.
VMap kv vv k v -> KVVector kv vv (k, v)
unVMap
{-# INLINE foldMap #-}
fold :: (VG.Vector vv m, Monoid m) => VMap kv vv k m -> m
fold :: VMap kv vv k m -> m
fold = (m -> m) -> vv m -> m
forall m (v :: * -> *) a.
(Monoid m, Vector v a) =>
(a -> m) -> v a -> m
VG.foldMap' m -> m
forall a. a -> a
id (vv m -> m) -> (VMap kv vv k m -> vv m) -> VMap kv vv k m -> m
forall b c a. (b -> c) -> (a -> b) -> a -> c
. KVVector kv vv (k, m) -> vv m
forall (kv :: * -> *) (vv :: * -> *) a.
KVVector kv vv a -> vv (Value a)
valsVector (KVVector kv vv (k, m) -> vv m)
-> (VMap kv vv k m -> KVVector kv vv (k, m))
-> VMap kv vv k m
-> vv m
forall b c a. (b -> c) -> (a -> b) -> a -> c
. VMap kv vv k m -> KVVector kv vv (k, m)
forall (kv :: * -> *) (vv :: * -> *) k v.
VMap kv vv k v -> KVVector kv vv (k, v)
unVMap
{-# INLINE fold #-}
keys :: VG.Vector kv k => VMap kv vv k v -> [k]
keys :: VMap kv vv k v -> [k]
keys = kv k -> [k]
forall (v :: * -> *) a. Vector v a => v a -> [a]
VG.toList (kv k -> [k]) -> (VMap kv vv k v -> kv k) -> VMap kv vv k v -> [k]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. KVVector kv vv (k, v) -> kv k
forall (kv :: * -> *) (vv :: * -> *) a.
KVVector kv vv a -> kv (Key a)
keysVector (KVVector kv vv (k, v) -> kv k)
-> (VMap kv vv k v -> KVVector kv vv (k, v))
-> VMap kv vv k v
-> kv k
forall b c a. (b -> c) -> (a -> b) -> a -> c
. VMap kv vv k v -> KVVector kv vv (k, v)
forall (kv :: * -> *) (vv :: * -> *) k v.
VMap kv vv k v -> KVVector kv vv (k, v)
unVMap
{-# INLINE keys #-}
elems :: VG.Vector vv v => VMap kv vv k v -> [v]
elems :: VMap kv vv k v -> [v]
elems = vv v -> [v]
forall (v :: * -> *) a. Vector v a => v a -> [a]
VG.toList (vv v -> [v]) -> (VMap kv vv k v -> vv v) -> VMap kv vv k v -> [v]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. KVVector kv vv (k, v) -> vv v
forall (kv :: * -> *) (vv :: * -> *) a.
KVVector kv vv a -> vv (Value a)
valsVector (KVVector kv vv (k, v) -> vv v)
-> (VMap kv vv k v -> KVVector kv vv (k, v))
-> VMap kv vv k v
-> vv v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. VMap kv vv k v -> KVVector kv vv (k, v)
forall (kv :: * -> *) (vv :: * -> *) k v.
VMap kv vv k v -> KVVector kv vv (k, v)
unVMap
{-# INLINE elems #-}
null :: (VG.Vector vv v, VG.Vector kv k) => VMap kv vv k v -> Bool
null :: VMap kv vv k v -> Bool
null (VMap KVVector kv vv (k, v)
vec) = KVVector kv vv (k, v) -> Bool
forall (v :: * -> *) a. Vector v a => v a -> Bool
VG.null KVVector kv vv (k, v)
vec
{-# INLINE null #-}
splitAt ::
(VG.Vector vv v, VG.Vector kv k) =>
Int ->
VMap kv vv k v ->
(VMap kv vv k v, VMap kv vv k v)
splitAt :: Int -> VMap kv vv k v -> (VMap kv vv k v, VMap kv vv k v)
splitAt Int
i (VMap KVVector kv vv (k, v)
vec) = let (KVVector kv vv (k, v)
l, KVVector kv vv (k, v)
r) = Int
-> KVVector kv vv (k, v)
-> (KVVector kv vv (k, v), KVVector kv vv (k, v))
forall (v :: * -> *) a. Vector v a => Int -> v a -> (v a, v a)
VG.splitAt Int
i KVVector kv vv (k, v)
vec in (KVVector kv vv (k, v) -> VMap kv vv k v
forall (kv :: * -> *) (vv :: * -> *) k v.
KVVector kv vv (k, v) -> VMap kv vv k v
VMap KVVector kv vv (k, v)
l, KVVector kv vv (k, v) -> VMap kv vv k v
forall (kv :: * -> *) (vv :: * -> *) k v.
KVVector kv vv (k, v) -> VMap kv vv k v
VMap KVVector kv vv (k, v)
r)
{-# INLINE splitAt #-}
internMaybe :: (VG.Vector kv k, Ord k) => k -> VMap kv vv k v -> Maybe k
internMaybe :: k -> VMap kv vv k v -> Maybe k
internMaybe k
key = k -> KVVector kv vv (k, v) -> Maybe k
forall (kv :: * -> *) k (vv :: * -> *) v.
(Vector kv k, Ord k) =>
k -> KVVector kv vv (k, v) -> Maybe k
KV.internKVVectorMaybe k
key (KVVector kv vv (k, v) -> Maybe k)
-> (VMap kv vv k v -> KVVector kv vv (k, v))
-> VMap kv vv k v
-> Maybe k
forall b c a. (b -> c) -> (a -> b) -> a -> c
. VMap kv vv k v -> KVVector kv vv (k, v)
forall (kv :: * -> *) (vv :: * -> *) k v.
VMap kv vv k v -> KVVector kv vv (k, v)
unVMap
{-# INLINE internMaybe #-}