module Calamity.Internal.SnowflakeMap where
import Calamity.Internal.Utils ()
import Calamity.Types.Snowflake
import Control.DeepSeq
import Control.Lens.At
import Control.Lens.Iso
import Control.Lens.Wrapped
import Data.Aeson ( FromJSON(..), ToJSON(..), withArray )
import Data.Data
import qualified Data.Foldable as F
import Data.HashMap.Lazy ( HashMap )
import qualified Data.HashMap.Lazy as LH
import Data.Hashable
import GHC.Exts ( IsList )
import GHC.Generics
import TextShow
import qualified TextShow.Generic as TSG
import Unsafe.Coerce
newtype SnowflakeMap a = SnowflakeMap
{ SnowflakeMap a -> HashMap (Snowflake a) a
unSnowflakeMap :: HashMap (Snowflake a) a
}
deriving ( (forall x. SnowflakeMap a -> Rep (SnowflakeMap a) x)
-> (forall x. Rep (SnowflakeMap a) x -> SnowflakeMap a)
-> Generic (SnowflakeMap a)
forall x. Rep (SnowflakeMap a) x -> SnowflakeMap a
forall x. SnowflakeMap a -> Rep (SnowflakeMap a) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall a x. Rep (SnowflakeMap a) x -> SnowflakeMap a
forall a x. SnowflakeMap a -> Rep (SnowflakeMap a) x
$cto :: forall a x. Rep (SnowflakeMap a) x -> SnowflakeMap a
$cfrom :: forall a x. SnowflakeMap a -> Rep (SnowflakeMap a) x
Generic, SnowflakeMap a -> SnowflakeMap a -> Bool
(SnowflakeMap a -> SnowflakeMap a -> Bool)
-> (SnowflakeMap a -> SnowflakeMap a -> Bool)
-> Eq (SnowflakeMap a)
forall a. Eq a => SnowflakeMap a -> SnowflakeMap a -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SnowflakeMap a -> SnowflakeMap a -> Bool
$c/= :: forall a. Eq a => SnowflakeMap a -> SnowflakeMap a -> Bool
== :: SnowflakeMap a -> SnowflakeMap a -> Bool
$c== :: forall a. Eq a => SnowflakeMap a -> SnowflakeMap a -> Bool
Eq, Typeable (SnowflakeMap a)
DataType
Constr
Typeable (SnowflakeMap a) =>
(forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> SnowflakeMap a -> c (SnowflakeMap a))
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (SnowflakeMap a))
-> (SnowflakeMap a -> Constr)
-> (SnowflakeMap a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (SnowflakeMap a)))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (SnowflakeMap a)))
-> ((forall b. Data b => b -> b)
-> SnowflakeMap a -> SnowflakeMap a)
-> (forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> SnowflakeMap a -> r)
-> (forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> SnowflakeMap a -> r)
-> (forall u.
(forall d. Data d => d -> u) -> SnowflakeMap a -> [u])
-> (forall u.
Int -> (forall d. Data d => d -> u) -> SnowflakeMap a -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> SnowflakeMap a -> m (SnowflakeMap a))
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> SnowflakeMap a -> m (SnowflakeMap a))
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> SnowflakeMap a -> m (SnowflakeMap a))
-> Data (SnowflakeMap a)
SnowflakeMap a -> DataType
SnowflakeMap a -> Constr
(forall d. Data d => c (t d)) -> Maybe (c (SnowflakeMap a))
(forall b. Data b => b -> b) -> SnowflakeMap a -> SnowflakeMap a
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> SnowflakeMap a -> c (SnowflakeMap a)
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (SnowflakeMap a)
forall a. Data a => Typeable (SnowflakeMap a)
forall a. Data a => SnowflakeMap a -> DataType
forall a. Data a => SnowflakeMap a -> Constr
forall a.
Data a =>
(forall b. Data b => b -> b) -> SnowflakeMap a -> SnowflakeMap a
forall a u.
Data a =>
Int -> (forall d. Data d => d -> u) -> SnowflakeMap a -> u
forall a u.
Data a =>
(forall d. Data d => d -> u) -> SnowflakeMap a -> [u]
forall a r r'.
Data a =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> SnowflakeMap a -> r
forall a r r'.
Data a =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> SnowflakeMap a -> r
forall a (m :: * -> *).
(Data a, Monad m) =>
(forall d. Data d => d -> m d)
-> SnowflakeMap a -> m (SnowflakeMap a)
forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> SnowflakeMap a -> m (SnowflakeMap a)
forall a (c :: * -> *).
Data a =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (SnowflakeMap a)
forall a (c :: * -> *).
Data a =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> SnowflakeMap a -> c (SnowflakeMap a)
forall a (t :: * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (SnowflakeMap a))
forall a (t :: * -> * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (SnowflakeMap a))
forall a.
Typeable a =>
(forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u.
Int -> (forall d. Data d => d -> u) -> SnowflakeMap a -> u
forall u. (forall d. Data d => d -> u) -> SnowflakeMap a -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> SnowflakeMap a -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> SnowflakeMap a -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> SnowflakeMap a -> m (SnowflakeMap a)
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> SnowflakeMap a -> m (SnowflakeMap a)
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (SnowflakeMap a)
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> SnowflakeMap a -> c (SnowflakeMap a)
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (SnowflakeMap a))
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (SnowflakeMap a))
$cSnowflakeMap :: Constr
$tSnowflakeMap :: DataType
gmapMo :: (forall d. Data d => d -> m d)
-> SnowflakeMap a -> m (SnowflakeMap a)
$cgmapMo :: forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> SnowflakeMap a -> m (SnowflakeMap a)
gmapMp :: (forall d. Data d => d -> m d)
-> SnowflakeMap a -> m (SnowflakeMap a)
$cgmapMp :: forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> SnowflakeMap a -> m (SnowflakeMap a)
gmapM :: (forall d. Data d => d -> m d)
-> SnowflakeMap a -> m (SnowflakeMap a)
$cgmapM :: forall a (m :: * -> *).
(Data a, Monad m) =>
(forall d. Data d => d -> m d)
-> SnowflakeMap a -> m (SnowflakeMap a)
gmapQi :: Int -> (forall d. Data d => d -> u) -> SnowflakeMap a -> u
$cgmapQi :: forall a u.
Data a =>
Int -> (forall d. Data d => d -> u) -> SnowflakeMap a -> u
gmapQ :: (forall d. Data d => d -> u) -> SnowflakeMap a -> [u]
$cgmapQ :: forall a u.
Data a =>
(forall d. Data d => d -> u) -> SnowflakeMap a -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> SnowflakeMap a -> r
$cgmapQr :: forall a r r'.
Data a =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> SnowflakeMap a -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> SnowflakeMap a -> r
$cgmapQl :: forall a r r'.
Data a =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> SnowflakeMap a -> r
gmapT :: (forall b. Data b => b -> b) -> SnowflakeMap a -> SnowflakeMap a
$cgmapT :: forall a.
Data a =>
(forall b. Data b => b -> b) -> SnowflakeMap a -> SnowflakeMap a
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (SnowflakeMap a))
$cdataCast2 :: forall a (t :: * -> * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (SnowflakeMap a))
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c (SnowflakeMap a))
$cdataCast1 :: forall a (t :: * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (SnowflakeMap a))
dataTypeOf :: SnowflakeMap a -> DataType
$cdataTypeOf :: forall a. Data a => SnowflakeMap a -> DataType
toConstr :: SnowflakeMap a -> Constr
$ctoConstr :: forall a. Data a => SnowflakeMap a -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (SnowflakeMap a)
$cgunfold :: forall a (c :: * -> *).
Data a =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (SnowflakeMap a)
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> SnowflakeMap a -> c (SnowflakeMap a)
$cgfoldl :: forall a (c :: * -> *).
Data a =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> SnowflakeMap a -> c (SnowflakeMap a)
$cp1Data :: forall a. Data a => Typeable (SnowflakeMap a)
Data, Eq (SnowflakeMap a)
Eq (SnowflakeMap a) =>
(SnowflakeMap a -> SnowflakeMap a -> Ordering)
-> (SnowflakeMap a -> SnowflakeMap a -> Bool)
-> (SnowflakeMap a -> SnowflakeMap a -> Bool)
-> (SnowflakeMap a -> SnowflakeMap a -> Bool)
-> (SnowflakeMap a -> SnowflakeMap a -> Bool)
-> (SnowflakeMap a -> SnowflakeMap a -> SnowflakeMap a)
-> (SnowflakeMap a -> SnowflakeMap a -> SnowflakeMap a)
-> Ord (SnowflakeMap a)
SnowflakeMap a -> SnowflakeMap a -> Bool
SnowflakeMap a -> SnowflakeMap a -> Ordering
SnowflakeMap a -> SnowflakeMap a -> SnowflakeMap a
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
forall a. Ord a => Eq (SnowflakeMap a)
forall a. Ord a => SnowflakeMap a -> SnowflakeMap a -> Bool
forall a. Ord a => SnowflakeMap a -> SnowflakeMap a -> Ordering
forall a.
Ord a =>
SnowflakeMap a -> SnowflakeMap a -> SnowflakeMap a
min :: SnowflakeMap a -> SnowflakeMap a -> SnowflakeMap a
$cmin :: forall a.
Ord a =>
SnowflakeMap a -> SnowflakeMap a -> SnowflakeMap a
max :: SnowflakeMap a -> SnowflakeMap a -> SnowflakeMap a
$cmax :: forall a.
Ord a =>
SnowflakeMap a -> SnowflakeMap a -> SnowflakeMap a
>= :: SnowflakeMap a -> SnowflakeMap a -> Bool
$c>= :: forall a. Ord a => SnowflakeMap a -> SnowflakeMap a -> Bool
> :: SnowflakeMap a -> SnowflakeMap a -> Bool
$c> :: forall a. Ord a => SnowflakeMap a -> SnowflakeMap a -> Bool
<= :: SnowflakeMap a -> SnowflakeMap a -> Bool
$c<= :: forall a. Ord a => SnowflakeMap a -> SnowflakeMap a -> Bool
< :: SnowflakeMap a -> SnowflakeMap a -> Bool
$c< :: forall a. Ord a => SnowflakeMap a -> SnowflakeMap a -> Bool
compare :: SnowflakeMap a -> SnowflakeMap a -> Ordering
$ccompare :: forall a. Ord a => SnowflakeMap a -> SnowflakeMap a -> Ordering
$cp1Ord :: forall a. Ord a => Eq (SnowflakeMap a)
Ord, Int -> SnowflakeMap a -> ShowS
[SnowflakeMap a] -> ShowS
SnowflakeMap a -> String
(Int -> SnowflakeMap a -> ShowS)
-> (SnowflakeMap a -> String)
-> ([SnowflakeMap a] -> ShowS)
-> Show (SnowflakeMap a)
forall a. Show a => Int -> SnowflakeMap a -> ShowS
forall a. Show a => [SnowflakeMap a] -> ShowS
forall a. Show a => SnowflakeMap a -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SnowflakeMap a] -> ShowS
$cshowList :: forall a. Show a => [SnowflakeMap a] -> ShowS
show :: SnowflakeMap a -> String
$cshow :: forall a. Show a => SnowflakeMap a -> String
showsPrec :: Int -> SnowflakeMap a -> ShowS
$cshowsPrec :: forall a. Show a => Int -> SnowflakeMap a -> ShowS
Show )
deriving ( Int -> SnowflakeMap a -> Builder
Int -> SnowflakeMap a -> Text
Int -> SnowflakeMap a -> Text
[SnowflakeMap a] -> Builder
[SnowflakeMap a] -> Text
[SnowflakeMap a] -> Text
SnowflakeMap a -> Builder
SnowflakeMap a -> Text
SnowflakeMap a -> Text
(Int -> SnowflakeMap a -> Builder)
-> (SnowflakeMap a -> Builder)
-> ([SnowflakeMap a] -> Builder)
-> (Int -> SnowflakeMap a -> Text)
-> (SnowflakeMap a -> Text)
-> ([SnowflakeMap a] -> Text)
-> (Int -> SnowflakeMap a -> Text)
-> (SnowflakeMap a -> Text)
-> ([SnowflakeMap a] -> Text)
-> TextShow (SnowflakeMap a)
forall a. Show a => Int -> SnowflakeMap a -> Builder
forall a. Show a => Int -> SnowflakeMap a -> Text
forall a. Show a => Int -> SnowflakeMap a -> Text
forall a. Show a => [SnowflakeMap a] -> Builder
forall a. Show a => [SnowflakeMap a] -> Text
forall a. Show a => [SnowflakeMap a] -> Text
forall a. Show a => SnowflakeMap a -> Builder
forall a. Show a => SnowflakeMap a -> Text
forall a. Show a => SnowflakeMap a -> Text
forall a.
(Int -> a -> Builder)
-> (a -> Builder)
-> ([a] -> Builder)
-> (Int -> a -> Text)
-> (a -> Text)
-> ([a] -> Text)
-> (Int -> a -> Text)
-> (a -> Text)
-> ([a] -> Text)
-> TextShow a
showtlList :: [SnowflakeMap a] -> Text
$cshowtlList :: forall a. Show a => [SnowflakeMap a] -> Text
showtl :: SnowflakeMap a -> Text
$cshowtl :: forall a. Show a => SnowflakeMap a -> Text
showtlPrec :: Int -> SnowflakeMap a -> Text
$cshowtlPrec :: forall a. Show a => Int -> SnowflakeMap a -> Text
showtList :: [SnowflakeMap a] -> Text
$cshowtList :: forall a. Show a => [SnowflakeMap a] -> Text
showt :: SnowflakeMap a -> Text
$cshowt :: forall a. Show a => SnowflakeMap a -> Text
showtPrec :: Int -> SnowflakeMap a -> Text
$cshowtPrec :: forall a. Show a => Int -> SnowflakeMap a -> Text
showbList :: [SnowflakeMap a] -> Builder
$cshowbList :: forall a. Show a => [SnowflakeMap a] -> Builder
showb :: SnowflakeMap a -> Builder
$cshowb :: forall a. Show a => SnowflakeMap a -> Builder
showbPrec :: Int -> SnowflakeMap a -> Builder
$cshowbPrec :: forall a. Show a => Int -> SnowflakeMap a -> Builder
TextShow ) via TSG.FromGeneric (SnowflakeMap a)
deriving newtype ( Int -> [Item (SnowflakeMap a)] -> SnowflakeMap a
[Item (SnowflakeMap a)] -> SnowflakeMap a
SnowflakeMap a -> [Item (SnowflakeMap a)]
([Item (SnowflakeMap a)] -> SnowflakeMap a)
-> (Int -> [Item (SnowflakeMap a)] -> SnowflakeMap a)
-> (SnowflakeMap a -> [Item (SnowflakeMap a)])
-> IsList (SnowflakeMap a)
forall a. Int -> [Item (SnowflakeMap a)] -> SnowflakeMap a
forall a. [Item (SnowflakeMap a)] -> SnowflakeMap a
forall a. SnowflakeMap a -> [Item (SnowflakeMap a)]
forall l.
([Item l] -> l)
-> (Int -> [Item l] -> l) -> (l -> [Item l]) -> IsList l
toList :: SnowflakeMap a -> [Item (SnowflakeMap a)]
$ctoList :: forall a. SnowflakeMap a -> [Item (SnowflakeMap a)]
fromListN :: Int -> [Item (SnowflakeMap a)] -> SnowflakeMap a
$cfromListN :: forall a. Int -> [Item (SnowflakeMap a)] -> SnowflakeMap a
fromList :: [Item (SnowflakeMap a)] -> SnowflakeMap a
$cfromList :: forall a. [Item (SnowflakeMap a)] -> SnowflakeMap a
IsList, b -> SnowflakeMap a -> SnowflakeMap a
NonEmpty (SnowflakeMap a) -> SnowflakeMap a
SnowflakeMap a -> SnowflakeMap a -> SnowflakeMap a
(SnowflakeMap a -> SnowflakeMap a -> SnowflakeMap a)
-> (NonEmpty (SnowflakeMap a) -> SnowflakeMap a)
-> (forall b. Integral b => b -> SnowflakeMap a -> SnowflakeMap a)
-> Semigroup (SnowflakeMap a)
forall b. Integral b => b -> SnowflakeMap a -> SnowflakeMap a
forall a. NonEmpty (SnowflakeMap a) -> SnowflakeMap a
forall a. SnowflakeMap a -> SnowflakeMap a -> SnowflakeMap a
forall a.
(a -> a -> a)
-> (NonEmpty a -> a)
-> (forall b. Integral b => b -> a -> a)
-> Semigroup a
forall a b. Integral b => b -> SnowflakeMap a -> SnowflakeMap a
stimes :: b -> SnowflakeMap a -> SnowflakeMap a
$cstimes :: forall a b. Integral b => b -> SnowflakeMap a -> SnowflakeMap a
sconcat :: NonEmpty (SnowflakeMap a) -> SnowflakeMap a
$csconcat :: forall a. NonEmpty (SnowflakeMap a) -> SnowflakeMap a
<> :: SnowflakeMap a -> SnowflakeMap a -> SnowflakeMap a
$c<> :: forall a. SnowflakeMap a -> SnowflakeMap a -> SnowflakeMap a
Semigroup, Semigroup (SnowflakeMap a)
SnowflakeMap a
Semigroup (SnowflakeMap a) =>
SnowflakeMap a
-> (SnowflakeMap a -> SnowflakeMap a -> SnowflakeMap a)
-> ([SnowflakeMap a] -> SnowflakeMap a)
-> Monoid (SnowflakeMap a)
[SnowflakeMap a] -> SnowflakeMap a
SnowflakeMap a -> SnowflakeMap a -> SnowflakeMap a
forall a. Semigroup (SnowflakeMap a)
forall a. SnowflakeMap a
forall a.
Semigroup a =>
a -> (a -> a -> a) -> ([a] -> a) -> Monoid a
forall a. [SnowflakeMap a] -> SnowflakeMap a
forall a. SnowflakeMap a -> SnowflakeMap a -> SnowflakeMap a
mconcat :: [SnowflakeMap a] -> SnowflakeMap a
$cmconcat :: forall a. [SnowflakeMap a] -> SnowflakeMap a
mappend :: SnowflakeMap a -> SnowflakeMap a -> SnowflakeMap a
$cmappend :: forall a. SnowflakeMap a -> SnowflakeMap a -> SnowflakeMap a
mempty :: SnowflakeMap a
$cmempty :: forall a. SnowflakeMap a
$cp1Monoid :: forall a. Semigroup (SnowflakeMap a)
Monoid )
deriving anyclass ( SnowflakeMap a -> ()
(SnowflakeMap a -> ()) -> NFData (SnowflakeMap a)
forall a. NFData a => SnowflakeMap a -> ()
forall a. (a -> ()) -> NFData a
rnf :: SnowflakeMap a -> ()
$crnf :: forall a. NFData a => SnowflakeMap a -> ()
NFData, Int -> SnowflakeMap a -> Int
SnowflakeMap a -> Int
(Int -> SnowflakeMap a -> Int)
-> (SnowflakeMap a -> Int) -> Hashable (SnowflakeMap a)
forall a. Hashable a => Int -> SnowflakeMap a -> Int
forall a. Hashable a => SnowflakeMap a -> Int
forall a. (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: SnowflakeMap a -> Int
$chash :: forall a. Hashable a => SnowflakeMap a -> Int
hashWithSalt :: Int -> SnowflakeMap a -> Int
$chashWithSalt :: forall a. Hashable a => Int -> SnowflakeMap a -> Int
Hashable )
instance Functor SnowflakeMap where
fmap :: (a -> b) -> SnowflakeMap a -> SnowflakeMap b
fmap f :: a -> b
f = HashMap (Snowflake b) b -> SnowflakeMap b
forall a. HashMap (Snowflake a) a -> SnowflakeMap a
SnowflakeMap (HashMap (Snowflake b) b -> SnowflakeMap b)
-> (SnowflakeMap a -> HashMap (Snowflake b) b)
-> SnowflakeMap a
-> SnowflakeMap b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. HashMap (Snowflake a) b -> HashMap (Snowflake b) b
forall a v b. HashMap (Snowflake a) v -> HashMap (Snowflake b) v
coerceSnowflakeMap (HashMap (Snowflake a) b -> HashMap (Snowflake b) b)
-> (SnowflakeMap a -> HashMap (Snowflake a) b)
-> SnowflakeMap a
-> HashMap (Snowflake b) b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (a -> b) -> HashMap (Snowflake a) a -> HashMap (Snowflake a) b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap a -> b
f (HashMap (Snowflake a) a -> HashMap (Snowflake a) b)
-> (SnowflakeMap a -> HashMap (Snowflake a) a)
-> SnowflakeMap a
-> HashMap (Snowflake a) b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. SnowflakeMap a -> HashMap (Snowflake a) a
forall a. SnowflakeMap a -> HashMap (Snowflake a) a
unSnowflakeMap
instance Foldable SnowflakeMap where
foldr :: (a -> b -> b) -> b -> SnowflakeMap a -> b
foldr f :: a -> b -> b
f b :: b
b = (a -> b -> b) -> b -> HashMap (Snowflake a) a -> b
forall (t :: * -> *) a b.
Foldable t =>
(a -> b -> b) -> b -> t a -> b
Prelude.foldr a -> b -> b
f b
b (HashMap (Snowflake a) a -> b)
-> (SnowflakeMap a -> HashMap (Snowflake a) a)
-> SnowflakeMap a
-> b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. SnowflakeMap a -> HashMap (Snowflake a) a
forall a. SnowflakeMap a -> HashMap (Snowflake a) a
unSnowflakeMap
instance Traversable SnowflakeMap where
traverse :: (a -> f b) -> SnowflakeMap a -> f (SnowflakeMap b)
traverse f :: a -> f b
f = (HashMap (Snowflake a) b -> SnowflakeMap b)
-> f (HashMap (Snowflake a) b) -> f (SnowflakeMap b)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (HashMap (Snowflake b) b -> SnowflakeMap b
forall a. HashMap (Snowflake a) a -> SnowflakeMap a
SnowflakeMap (HashMap (Snowflake b) b -> SnowflakeMap b)
-> (HashMap (Snowflake a) b -> HashMap (Snowflake b) b)
-> HashMap (Snowflake a) b
-> SnowflakeMap b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. HashMap (Snowflake a) b -> HashMap (Snowflake b) b
forall a v b. HashMap (Snowflake a) v -> HashMap (Snowflake b) v
coerceSnowflakeMap) (f (HashMap (Snowflake a) b) -> f (SnowflakeMap b))
-> (SnowflakeMap a -> f (HashMap (Snowflake a) b))
-> SnowflakeMap a
-> f (SnowflakeMap b)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (a -> f b)
-> HashMap (Snowflake a) a -> f (HashMap (Snowflake a) b)
forall (t :: * -> *) (f :: * -> *) a b.
(Traversable t, Applicative f) =>
(a -> f b) -> t a -> f (t b)
traverse a -> f b
f (HashMap (Snowflake a) a -> f (HashMap (Snowflake a) b))
-> (SnowflakeMap a -> HashMap (Snowflake a) a)
-> SnowflakeMap a
-> f (HashMap (Snowflake a) b)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. SnowflakeMap a -> HashMap (Snowflake a) a
forall a. SnowflakeMap a -> HashMap (Snowflake a) a
unSnowflakeMap
instance Wrapped (SnowflakeMap a) where
type Unwrapped (SnowflakeMap a) = HashMap (Snowflake a) a
_Wrapped' :: p (Unwrapped (SnowflakeMap a)) (f (Unwrapped (SnowflakeMap a)))
-> p (SnowflakeMap a) (f (SnowflakeMap a))
_Wrapped' = (SnowflakeMap a -> HashMap (Snowflake a) a)
-> (HashMap (Snowflake a) a -> SnowflakeMap a)
-> Iso
(SnowflakeMap a)
(SnowflakeMap a)
(HashMap (Snowflake a) a)
(HashMap (Snowflake a) a)
forall s a b t. (s -> a) -> (b -> t) -> Iso s t a b
iso SnowflakeMap a -> HashMap (Snowflake a) a
forall a. SnowflakeMap a -> HashMap (Snowflake a) a
unSnowflakeMap HashMap (Snowflake a) a -> SnowflakeMap a
forall a. HashMap (Snowflake a) a -> SnowflakeMap a
SnowflakeMap
type instance (Index (SnowflakeMap a)) = Snowflake a
type instance (IxValue (SnowflakeMap a)) = a
instance SnowflakeMap a ~ t => Rewrapped (SnowflakeMap b) a
instance Ixed (SnowflakeMap a) where
ix :: Index (SnowflakeMap a)
-> Traversal' (SnowflakeMap a) (IxValue (SnowflakeMap a))
ix i :: Index (SnowflakeMap a)
i = (HashMap (Snowflake a) a -> f (HashMap (Snowflake a) a))
-> SnowflakeMap a -> f (SnowflakeMap a)
forall s t. Rewrapping s t => Iso s t (Unwrapped s) (Unwrapped t)
_Wrapped ((HashMap (Snowflake a) a -> f (HashMap (Snowflake a) a))
-> SnowflakeMap a -> f (SnowflakeMap a))
-> ((a -> f a)
-> HashMap (Snowflake a) a -> f (HashMap (Snowflake a) a))
-> (a -> f a)
-> SnowflakeMap a
-> f (SnowflakeMap a)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Index (HashMap (Snowflake a) a)
-> Traversal'
(HashMap (Snowflake a) a) (IxValue (HashMap (Snowflake a) a))
forall m. Ixed m => Index m -> Traversal' m (IxValue m)
ix Index (HashMap (Snowflake a) a)
Index (SnowflakeMap a)
i
instance At (SnowflakeMap a) where
at :: Index (SnowflakeMap a)
-> Lens' (SnowflakeMap a) (Maybe (IxValue (SnowflakeMap a)))
at i :: Index (SnowflakeMap a)
i = (HashMap (Snowflake a) a -> f (HashMap (Snowflake a) a))
-> SnowflakeMap a -> f (SnowflakeMap a)
forall s t. Rewrapping s t => Iso s t (Unwrapped s) (Unwrapped t)
_Wrapped ((HashMap (Snowflake a) a -> f (HashMap (Snowflake a) a))
-> SnowflakeMap a -> f (SnowflakeMap a))
-> ((Maybe a -> f (Maybe a))
-> HashMap (Snowflake a) a -> f (HashMap (Snowflake a) a))
-> (Maybe a -> f (Maybe a))
-> SnowflakeMap a
-> f (SnowflakeMap a)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Index (HashMap (Snowflake a) a)
-> Lens'
(HashMap (Snowflake a) a)
(Maybe (IxValue (HashMap (Snowflake a) a)))
forall m. At m => Index m -> Lens' m (Maybe (IxValue m))
at Index (HashMap (Snowflake a) a)
Index (SnowflakeMap a)
i
over :: (HashMap (Snowflake a) a -> HashMap (Snowflake b) b) -> SnowflakeMap a -> SnowflakeMap b
over :: (HashMap (Snowflake a) a -> HashMap (Snowflake b) b)
-> SnowflakeMap a -> SnowflakeMap b
over f :: HashMap (Snowflake a) a -> HashMap (Snowflake b) b
f = HashMap (Snowflake b) b -> SnowflakeMap b
forall a. HashMap (Snowflake a) a -> SnowflakeMap a
SnowflakeMap (HashMap (Snowflake b) b -> SnowflakeMap b)
-> (SnowflakeMap a -> HashMap (Snowflake b) b)
-> SnowflakeMap a
-> SnowflakeMap b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. HashMap (Snowflake a) a -> HashMap (Snowflake b) b
f (HashMap (Snowflake a) a -> HashMap (Snowflake b) b)
-> (SnowflakeMap a -> HashMap (Snowflake a) a)
-> SnowflakeMap a
-> HashMap (Snowflake b) b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. SnowflakeMap a -> HashMap (Snowflake a) a
forall a. SnowflakeMap a -> HashMap (Snowflake a) a
unSnowflakeMap
{-# INLINABLE over #-}
coerceSnowflakeMap :: HashMap (Snowflake a) v -> HashMap (Snowflake b) v
coerceSnowflakeMap :: HashMap (Snowflake a) v -> HashMap (Snowflake b) v
coerceSnowflakeMap = HashMap (Snowflake a) v -> HashMap (Snowflake b) v
forall a b. a -> b
unsafeCoerce
{-# INLINABLE coerceSnowflakeMap #-}
empty :: SnowflakeMap a
empty :: SnowflakeMap a
empty = HashMap (Snowflake a) a -> SnowflakeMap a
forall a. HashMap (Snowflake a) a -> SnowflakeMap a
SnowflakeMap HashMap (Snowflake a) a
forall k v. HashMap k v
LH.empty
{-# INLINABLE empty #-}
singleton :: HasID' a => a -> SnowflakeMap a
singleton :: a -> SnowflakeMap a
singleton v :: a
v = HashMap (Snowflake a) a -> SnowflakeMap a
forall a. HashMap (Snowflake a) a -> SnowflakeMap a
SnowflakeMap (HashMap (Snowflake a) a -> SnowflakeMap a)
-> HashMap (Snowflake a) a -> SnowflakeMap a
forall a b. (a -> b) -> a -> b
$ Snowflake a -> a -> HashMap (Snowflake a) a
forall k v. Hashable k => k -> v -> HashMap k v
LH.singleton (a -> Snowflake a
forall b a. HasID b a => a -> Snowflake b
getID a
v) a
v
{-# INLINABLE singleton #-}
null :: SnowflakeMap a -> Bool
null :: SnowflakeMap a -> Bool
null = HashMap (Snowflake a) a -> Bool
forall k v. HashMap k v -> Bool
LH.null (HashMap (Snowflake a) a -> Bool)
-> (SnowflakeMap a -> HashMap (Snowflake a) a)
-> SnowflakeMap a
-> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. SnowflakeMap a -> HashMap (Snowflake a) a
forall a. SnowflakeMap a -> HashMap (Snowflake a) a
unSnowflakeMap
{-# INLINABLE null #-}
size :: SnowflakeMap a -> Int
size :: SnowflakeMap a -> Int
size = HashMap (Snowflake a) a -> Int
forall k v. HashMap k v -> Int
LH.size (HashMap (Snowflake a) a -> Int)
-> (SnowflakeMap a -> HashMap (Snowflake a) a)
-> SnowflakeMap a
-> Int
forall b c a. (b -> c) -> (a -> b) -> a -> c
. SnowflakeMap a -> HashMap (Snowflake a) a
forall a. SnowflakeMap a -> HashMap (Snowflake a) a
unSnowflakeMap
{-# INLINABLE size #-}
member :: Snowflake a -> SnowflakeMap a -> Bool
member :: Snowflake a -> SnowflakeMap a -> Bool
member k :: Snowflake a
k = Snowflake a -> HashMap (Snowflake a) a -> Bool
forall k a. (Eq k, Hashable k) => k -> HashMap k a -> Bool
LH.member Snowflake a
k (HashMap (Snowflake a) a -> Bool)
-> (SnowflakeMap a -> HashMap (Snowflake a) a)
-> SnowflakeMap a
-> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. SnowflakeMap a -> HashMap (Snowflake a) a
forall a. SnowflakeMap a -> HashMap (Snowflake a) a
unSnowflakeMap
{-# INLINABLE member #-}
lookup :: Snowflake a -> SnowflakeMap a -> Maybe a
lookup :: Snowflake a -> SnowflakeMap a -> Maybe a
lookup k :: Snowflake a
k = Snowflake a -> HashMap (Snowflake a) a -> Maybe a
forall k v. (Eq k, Hashable k) => k -> HashMap k v -> Maybe v
LH.lookup Snowflake a
k (HashMap (Snowflake a) a -> Maybe a)
-> (SnowflakeMap a -> HashMap (Snowflake a) a)
-> SnowflakeMap a
-> Maybe a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. SnowflakeMap a -> HashMap (Snowflake a) a
forall a. SnowflakeMap a -> HashMap (Snowflake a) a
unSnowflakeMap
{-# INLINABLE lookup #-}
lookupDefault :: a -> Snowflake a -> SnowflakeMap a -> a
lookupDefault :: a -> Snowflake a -> SnowflakeMap a -> a
lookupDefault d :: a
d k :: Snowflake a
k = a -> Snowflake a -> HashMap (Snowflake a) a -> a
forall k v. (Eq k, Hashable k) => v -> k -> HashMap k v -> v
LH.lookupDefault a
d Snowflake a
k (HashMap (Snowflake a) a -> a)
-> (SnowflakeMap a -> HashMap (Snowflake a) a)
-> SnowflakeMap a
-> a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. SnowflakeMap a -> HashMap (Snowflake a) a
forall a. SnowflakeMap a -> HashMap (Snowflake a) a
unSnowflakeMap
{-# INLINABLE lookupDefault #-}
(!) :: SnowflakeMap a -> Snowflake a -> a
(!) m :: SnowflakeMap a
m k :: Snowflake a
k = SnowflakeMap a -> HashMap (Snowflake a) a
forall a. SnowflakeMap a -> HashMap (Snowflake a) a
unSnowflakeMap SnowflakeMap a
m HashMap (Snowflake a) a -> Snowflake a -> a
forall k v. (Eq k, Hashable k) => HashMap k v -> k -> v
LH.! Snowflake a
k
{-# INLINABLE (!) #-}
insert :: HasID' a => a -> SnowflakeMap a -> SnowflakeMap a
insert :: a -> SnowflakeMap a -> SnowflakeMap a
insert v :: a
v = (HashMap (Snowflake a) a -> HashMap (Snowflake a) a)
-> SnowflakeMap a -> SnowflakeMap a
forall a b.
(HashMap (Snowflake a) a -> HashMap (Snowflake b) b)
-> SnowflakeMap a -> SnowflakeMap b
over ((HashMap (Snowflake a) a -> HashMap (Snowflake a) a)
-> SnowflakeMap a -> SnowflakeMap a)
-> (HashMap (Snowflake a) a -> HashMap (Snowflake a) a)
-> SnowflakeMap a
-> SnowflakeMap a
forall a b. (a -> b) -> a -> b
$ Snowflake a
-> a -> HashMap (Snowflake a) a -> HashMap (Snowflake a) a
forall k v.
(Eq k, Hashable k) =>
k -> v -> HashMap k v -> HashMap k v
LH.insert (a -> Snowflake a
forall b a. HasID b a => a -> Snowflake b
getID a
v) a
v
{-# INLINABLE insert #-}
insertWith :: HasID' a => (a -> a -> a) -> a -> SnowflakeMap a -> SnowflakeMap a
insertWith :: (a -> a -> a) -> a -> SnowflakeMap a -> SnowflakeMap a
insertWith f :: a -> a -> a
f v :: a
v = (HashMap (Snowflake a) a -> HashMap (Snowflake a) a)
-> SnowflakeMap a -> SnowflakeMap a
forall a b.
(HashMap (Snowflake a) a -> HashMap (Snowflake b) b)
-> SnowflakeMap a -> SnowflakeMap b
over ((HashMap (Snowflake a) a -> HashMap (Snowflake a) a)
-> SnowflakeMap a -> SnowflakeMap a)
-> (HashMap (Snowflake a) a -> HashMap (Snowflake a) a)
-> SnowflakeMap a
-> SnowflakeMap a
forall a b. (a -> b) -> a -> b
$ (a -> a -> a)
-> Snowflake a
-> a
-> HashMap (Snowflake a) a
-> HashMap (Snowflake a) a
forall k v.
(Eq k, Hashable k) =>
(v -> v -> v) -> k -> v -> HashMap k v -> HashMap k v
LH.insertWith a -> a -> a
f (a -> Snowflake a
forall b a. HasID b a => a -> Snowflake b
getID a
v) a
v
{-# INLINABLE insertWith #-}
delete :: Snowflake a -> SnowflakeMap a -> SnowflakeMap a
delete :: Snowflake a -> SnowflakeMap a -> SnowflakeMap a
delete k :: Snowflake a
k = (HashMap (Snowflake a) a -> HashMap (Snowflake a) a)
-> SnowflakeMap a -> SnowflakeMap a
forall a b.
(HashMap (Snowflake a) a -> HashMap (Snowflake b) b)
-> SnowflakeMap a -> SnowflakeMap b
over ((HashMap (Snowflake a) a -> HashMap (Snowflake a) a)
-> SnowflakeMap a -> SnowflakeMap a)
-> (HashMap (Snowflake a) a -> HashMap (Snowflake a) a)
-> SnowflakeMap a
-> SnowflakeMap a
forall a b. (a -> b) -> a -> b
$ Snowflake a -> HashMap (Snowflake a) a -> HashMap (Snowflake a) a
forall k v. (Eq k, Hashable k) => k -> HashMap k v -> HashMap k v
LH.delete Snowflake a
k
{-# INLINABLE delete #-}
adjust :: (a -> a) -> Snowflake a -> SnowflakeMap a -> SnowflakeMap a
adjust :: (a -> a) -> Snowflake a -> SnowflakeMap a -> SnowflakeMap a
adjust f :: a -> a
f k :: Snowflake a
k = (HashMap (Snowflake a) a -> HashMap (Snowflake a) a)
-> SnowflakeMap a -> SnowflakeMap a
forall a b.
(HashMap (Snowflake a) a -> HashMap (Snowflake b) b)
-> SnowflakeMap a -> SnowflakeMap b
over ((HashMap (Snowflake a) a -> HashMap (Snowflake a) a)
-> SnowflakeMap a -> SnowflakeMap a)
-> (HashMap (Snowflake a) a -> HashMap (Snowflake a) a)
-> SnowflakeMap a
-> SnowflakeMap a
forall a b. (a -> b) -> a -> b
$ (a -> a)
-> Snowflake a
-> HashMap (Snowflake a) a
-> HashMap (Snowflake a) a
forall k v.
(Eq k, Hashable k) =>
(v -> v) -> k -> HashMap k v -> HashMap k v
LH.adjust a -> a
f Snowflake a
k
{-# INLINABLE adjust #-}
update :: (a -> Maybe a) -> Snowflake a -> SnowflakeMap a -> SnowflakeMap a
update :: (a -> Maybe a) -> Snowflake a -> SnowflakeMap a -> SnowflakeMap a
update f :: a -> Maybe a
f k :: Snowflake a
k = (HashMap (Snowflake a) a -> HashMap (Snowflake a) a)
-> SnowflakeMap a -> SnowflakeMap a
forall a b.
(HashMap (Snowflake a) a -> HashMap (Snowflake b) b)
-> SnowflakeMap a -> SnowflakeMap b
over ((HashMap (Snowflake a) a -> HashMap (Snowflake a) a)
-> SnowflakeMap a -> SnowflakeMap a)
-> (HashMap (Snowflake a) a -> HashMap (Snowflake a) a)
-> SnowflakeMap a
-> SnowflakeMap a
forall a b. (a -> b) -> a -> b
$ (a -> Maybe a)
-> Snowflake a
-> HashMap (Snowflake a) a
-> HashMap (Snowflake a) a
forall k a.
(Eq k, Hashable k) =>
(a -> Maybe a) -> k -> HashMap k a -> HashMap k a
LH.update a -> Maybe a
f Snowflake a
k
{-# INLINABLE update #-}
alter :: (Maybe a -> Maybe a) -> Snowflake a -> SnowflakeMap a -> SnowflakeMap a
alter :: (Maybe a -> Maybe a)
-> Snowflake a -> SnowflakeMap a -> SnowflakeMap a
alter f :: Maybe a -> Maybe a
f k :: Snowflake a
k = (HashMap (Snowflake a) a -> HashMap (Snowflake a) a)
-> SnowflakeMap a -> SnowflakeMap a
forall a b.
(HashMap (Snowflake a) a -> HashMap (Snowflake b) b)
-> SnowflakeMap a -> SnowflakeMap b
over ((HashMap (Snowflake a) a -> HashMap (Snowflake a) a)
-> SnowflakeMap a -> SnowflakeMap a)
-> (HashMap (Snowflake a) a -> HashMap (Snowflake a) a)
-> SnowflakeMap a
-> SnowflakeMap a
forall a b. (a -> b) -> a -> b
$ (Maybe a -> Maybe a)
-> Snowflake a
-> HashMap (Snowflake a) a
-> HashMap (Snowflake a) a
forall k v.
(Eq k, Hashable k) =>
(Maybe v -> Maybe v) -> k -> HashMap k v -> HashMap k v
LH.alter Maybe a -> Maybe a
f Snowflake a
k
{-# INLINABLE alter #-}
union :: SnowflakeMap a -> SnowflakeMap a -> SnowflakeMap a
union :: SnowflakeMap a -> SnowflakeMap a -> SnowflakeMap a
union m :: SnowflakeMap a
m m' :: SnowflakeMap a
m' = HashMap (Snowflake a) a -> SnowflakeMap a
forall a. HashMap (Snowflake a) a -> SnowflakeMap a
SnowflakeMap (HashMap (Snowflake a) a -> SnowflakeMap a)
-> HashMap (Snowflake a) a -> SnowflakeMap a
forall a b. (a -> b) -> a -> b
$ HashMap (Snowflake a) a
-> HashMap (Snowflake a) a -> HashMap (Snowflake a) a
forall k v.
(Eq k, Hashable k) =>
HashMap k v -> HashMap k v -> HashMap k v
LH.union (SnowflakeMap a -> HashMap (Snowflake a) a
forall a. SnowflakeMap a -> HashMap (Snowflake a) a
unSnowflakeMap SnowflakeMap a
m) (SnowflakeMap a -> HashMap (Snowflake a) a
forall a. SnowflakeMap a -> HashMap (Snowflake a) a
unSnowflakeMap SnowflakeMap a
m')
{-# INLINABLE union #-}
unionWith :: (a -> a -> a) -> SnowflakeMap a -> SnowflakeMap a -> SnowflakeMap a
unionWith :: (a -> a -> a) -> SnowflakeMap a -> SnowflakeMap a -> SnowflakeMap a
unionWith f :: a -> a -> a
f m :: SnowflakeMap a
m m' :: SnowflakeMap a
m' = HashMap (Snowflake a) a -> SnowflakeMap a
forall a. HashMap (Snowflake a) a -> SnowflakeMap a
SnowflakeMap (HashMap (Snowflake a) a -> SnowflakeMap a)
-> HashMap (Snowflake a) a -> SnowflakeMap a
forall a b. (a -> b) -> a -> b
$ (a -> a -> a)
-> HashMap (Snowflake a) a
-> HashMap (Snowflake a) a
-> HashMap (Snowflake a) a
forall k v.
(Eq k, Hashable k) =>
(v -> v -> v) -> HashMap k v -> HashMap k v -> HashMap k v
LH.unionWith a -> a -> a
f (SnowflakeMap a -> HashMap (Snowflake a) a
forall a. SnowflakeMap a -> HashMap (Snowflake a) a
unSnowflakeMap SnowflakeMap a
m) (SnowflakeMap a -> HashMap (Snowflake a) a
forall a. SnowflakeMap a -> HashMap (Snowflake a) a
unSnowflakeMap SnowflakeMap a
m')
{-# INLINABLE unionWith #-}
unionWithKey :: (Snowflake a -> a -> a -> a) -> SnowflakeMap a -> SnowflakeMap a -> SnowflakeMap a
unionWithKey :: (Snowflake a -> a -> a -> a)
-> SnowflakeMap a -> SnowflakeMap a -> SnowflakeMap a
unionWithKey f :: Snowflake a -> a -> a -> a
f m :: SnowflakeMap a
m m' :: SnowflakeMap a
m' = HashMap (Snowflake a) a -> SnowflakeMap a
forall a. HashMap (Snowflake a) a -> SnowflakeMap a
SnowflakeMap (HashMap (Snowflake a) a -> SnowflakeMap a)
-> HashMap (Snowflake a) a -> SnowflakeMap a
forall a b. (a -> b) -> a -> b
$ (Snowflake a -> a -> a -> a)
-> HashMap (Snowflake a) a
-> HashMap (Snowflake a) a
-> HashMap (Snowflake a) a
forall k v.
(Eq k, Hashable k) =>
(k -> v -> v -> v) -> HashMap k v -> HashMap k v -> HashMap k v
LH.unionWithKey Snowflake a -> a -> a -> a
f (SnowflakeMap a -> HashMap (Snowflake a) a
forall a. SnowflakeMap a -> HashMap (Snowflake a) a
unSnowflakeMap SnowflakeMap a
m) (SnowflakeMap a -> HashMap (Snowflake a) a
forall a. SnowflakeMap a -> HashMap (Snowflake a) a
unSnowflakeMap SnowflakeMap a
m')
{-# INLINABLE unionWithKey #-}
unions :: [SnowflakeMap a] -> SnowflakeMap a
unions :: [SnowflakeMap a] -> SnowflakeMap a
unions = HashMap (Snowflake a) a -> SnowflakeMap a
forall a. HashMap (Snowflake a) a -> SnowflakeMap a
SnowflakeMap (HashMap (Snowflake a) a -> SnowflakeMap a)
-> ([SnowflakeMap a] -> HashMap (Snowflake a) a)
-> [SnowflakeMap a]
-> SnowflakeMap a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [HashMap (Snowflake a) a] -> HashMap (Snowflake a) a
forall k v. (Eq k, Hashable k) => [HashMap k v] -> HashMap k v
LH.unions ([HashMap (Snowflake a) a] -> HashMap (Snowflake a) a)
-> ([SnowflakeMap a] -> [HashMap (Snowflake a) a])
-> [SnowflakeMap a]
-> HashMap (Snowflake a) a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (SnowflakeMap a -> HashMap (Snowflake a) a)
-> [SnowflakeMap a] -> [HashMap (Snowflake a) a]
forall a b. (a -> b) -> [a] -> [b]
Prelude.map SnowflakeMap a -> HashMap (Snowflake a) a
forall a. SnowflakeMap a -> HashMap (Snowflake a) a
unSnowflakeMap
{-# INLINABLE unions #-}
map :: (a1 -> a2) -> SnowflakeMap a1 -> SnowflakeMap a2
map :: (a1 -> a2) -> SnowflakeMap a1 -> SnowflakeMap a2
map f :: a1 -> a2
f = (HashMap (Snowflake a1) a1 -> HashMap (Snowflake a2) a2)
-> SnowflakeMap a1 -> SnowflakeMap a2
forall a b.
(HashMap (Snowflake a) a -> HashMap (Snowflake b) b)
-> SnowflakeMap a -> SnowflakeMap b
over ((HashMap (Snowflake a1) a1 -> HashMap (Snowflake a2) a2)
-> SnowflakeMap a1 -> SnowflakeMap a2)
-> (HashMap (Snowflake a1) a1 -> HashMap (Snowflake a2) a2)
-> SnowflakeMap a1
-> SnowflakeMap a2
forall a b. (a -> b) -> a -> b
$ HashMap (Snowflake a1) a2 -> HashMap (Snowflake a2) a2
forall a v b. HashMap (Snowflake a) v -> HashMap (Snowflake b) v
coerceSnowflakeMap (HashMap (Snowflake a1) a2 -> HashMap (Snowflake a2) a2)
-> (HashMap (Snowflake a1) a1 -> HashMap (Snowflake a1) a2)
-> HashMap (Snowflake a1) a1
-> HashMap (Snowflake a2) a2
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (a1 -> a2)
-> HashMap (Snowflake a1) a1 -> HashMap (Snowflake a1) a2
forall v1 v2 k. (v1 -> v2) -> HashMap k v1 -> HashMap k v2
LH.map a1 -> a2
f
{-# INLINABLE map #-}
mapWithKey :: (Snowflake a1 -> a1 -> a2) -> SnowflakeMap a1 -> SnowflakeMap a2
mapWithKey :: (Snowflake a1 -> a1 -> a2) -> SnowflakeMap a1 -> SnowflakeMap a2
mapWithKey f :: Snowflake a1 -> a1 -> a2
f = (HashMap (Snowflake a1) a1 -> HashMap (Snowflake a2) a2)
-> SnowflakeMap a1 -> SnowflakeMap a2
forall a b.
(HashMap (Snowflake a) a -> HashMap (Snowflake b) b)
-> SnowflakeMap a -> SnowflakeMap b
over ((HashMap (Snowflake a1) a1 -> HashMap (Snowflake a2) a2)
-> SnowflakeMap a1 -> SnowflakeMap a2)
-> (HashMap (Snowflake a1) a1 -> HashMap (Snowflake a2) a2)
-> SnowflakeMap a1
-> SnowflakeMap a2
forall a b. (a -> b) -> a -> b
$ HashMap (Snowflake a1) a2 -> HashMap (Snowflake a2) a2
forall a v b. HashMap (Snowflake a) v -> HashMap (Snowflake b) v
coerceSnowflakeMap (HashMap (Snowflake a1) a2 -> HashMap (Snowflake a2) a2)
-> (HashMap (Snowflake a1) a1 -> HashMap (Snowflake a1) a2)
-> HashMap (Snowflake a1) a1
-> HashMap (Snowflake a2) a2
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Snowflake a1 -> a1 -> a2)
-> HashMap (Snowflake a1) a1 -> HashMap (Snowflake a1) a2
forall k v1 v2. (k -> v1 -> v2) -> HashMap k v1 -> HashMap k v2
LH.mapWithKey Snowflake a1 -> a1 -> a2
f
{-# INLINABLE mapWithKey #-}
traverseWithKey :: Applicative f => (Snowflake a1 -> a1 -> f a2) -> SnowflakeMap a1 -> f (SnowflakeMap a2)
traverseWithKey :: (Snowflake a1 -> a1 -> f a2)
-> SnowflakeMap a1 -> f (SnowflakeMap a2)
traverseWithKey f :: Snowflake a1 -> a1 -> f a2
f = (HashMap (Snowflake a1) a2 -> SnowflakeMap a2)
-> f (HashMap (Snowflake a1) a2) -> f (SnowflakeMap a2)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (HashMap (Snowflake a2) a2 -> SnowflakeMap a2
forall a. HashMap (Snowflake a) a -> SnowflakeMap a
SnowflakeMap (HashMap (Snowflake a2) a2 -> SnowflakeMap a2)
-> (HashMap (Snowflake a1) a2 -> HashMap (Snowflake a2) a2)
-> HashMap (Snowflake a1) a2
-> SnowflakeMap a2
forall b c a. (b -> c) -> (a -> b) -> a -> c
. HashMap (Snowflake a1) a2 -> HashMap (Snowflake a2) a2
forall a v b. HashMap (Snowflake a) v -> HashMap (Snowflake b) v
coerceSnowflakeMap) (f (HashMap (Snowflake a1) a2) -> f (SnowflakeMap a2))
-> (SnowflakeMap a1 -> f (HashMap (Snowflake a1) a2))
-> SnowflakeMap a1
-> f (SnowflakeMap a2)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Snowflake a1 -> a1 -> f a2)
-> HashMap (Snowflake a1) a1 -> f (HashMap (Snowflake a1) a2)
forall (f :: * -> *) k v1 v2.
Applicative f =>
(k -> v1 -> f v2) -> HashMap k v1 -> f (HashMap k v2)
LH.traverseWithKey Snowflake a1 -> a1 -> f a2
f (HashMap (Snowflake a1) a1 -> f (HashMap (Snowflake a1) a2))
-> (SnowflakeMap a1 -> HashMap (Snowflake a1) a1)
-> SnowflakeMap a1
-> f (HashMap (Snowflake a1) a2)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. SnowflakeMap a1 -> HashMap (Snowflake a1) a1
forall a. SnowflakeMap a -> HashMap (Snowflake a) a
unSnowflakeMap
{-# INLINABLE traverseWithKey #-}
difference :: SnowflakeMap a -> SnowflakeMap a -> SnowflakeMap a
difference :: SnowflakeMap a -> SnowflakeMap a -> SnowflakeMap a
difference m :: SnowflakeMap a
m m' :: SnowflakeMap a
m' = HashMap (Snowflake a) a -> SnowflakeMap a
forall a. HashMap (Snowflake a) a -> SnowflakeMap a
SnowflakeMap (HashMap (Snowflake a) a -> SnowflakeMap a)
-> HashMap (Snowflake a) a -> SnowflakeMap a
forall a b. (a -> b) -> a -> b
$ HashMap (Snowflake a) a
-> HashMap (Snowflake a) a -> HashMap (Snowflake a) a
forall k v w.
(Eq k, Hashable k) =>
HashMap k v -> HashMap k w -> HashMap k v
LH.difference (SnowflakeMap a -> HashMap (Snowflake a) a
forall a. SnowflakeMap a -> HashMap (Snowflake a) a
unSnowflakeMap SnowflakeMap a
m) (SnowflakeMap a -> HashMap (Snowflake a) a
forall a. SnowflakeMap a -> HashMap (Snowflake a) a
unSnowflakeMap SnowflakeMap a
m')
{-# INLINABLE difference #-}
differenceWith :: (a -> a -> Maybe a) -> SnowflakeMap a -> SnowflakeMap a -> SnowflakeMap a
differenceWith :: (a -> a -> Maybe a)
-> SnowflakeMap a -> SnowflakeMap a -> SnowflakeMap a
differenceWith f :: a -> a -> Maybe a
f m :: SnowflakeMap a
m m' :: SnowflakeMap a
m' = HashMap (Snowflake a) a -> SnowflakeMap a
forall a. HashMap (Snowflake a) a -> SnowflakeMap a
SnowflakeMap (HashMap (Snowflake a) a -> SnowflakeMap a)
-> HashMap (Snowflake a) a -> SnowflakeMap a
forall a b. (a -> b) -> a -> b
$ (a -> a -> Maybe a)
-> HashMap (Snowflake a) a
-> HashMap (Snowflake a) a
-> HashMap (Snowflake a) a
forall k v w.
(Eq k, Hashable k) =>
(v -> w -> Maybe v) -> HashMap k v -> HashMap k w -> HashMap k v
LH.differenceWith a -> a -> Maybe a
f (SnowflakeMap a -> HashMap (Snowflake a) a
forall a. SnowflakeMap a -> HashMap (Snowflake a) a
unSnowflakeMap SnowflakeMap a
m) (SnowflakeMap a -> HashMap (Snowflake a) a
forall a. SnowflakeMap a -> HashMap (Snowflake a) a
unSnowflakeMap SnowflakeMap a
m')
{-# INLINABLE differenceWith #-}
intersection :: SnowflakeMap a -> SnowflakeMap a -> SnowflakeMap a
intersection :: SnowflakeMap a -> SnowflakeMap a -> SnowflakeMap a
intersection m :: SnowflakeMap a
m m' :: SnowflakeMap a
m' = HashMap (Snowflake a) a -> SnowflakeMap a
forall a. HashMap (Snowflake a) a -> SnowflakeMap a
SnowflakeMap (HashMap (Snowflake a) a -> SnowflakeMap a)
-> HashMap (Snowflake a) a -> SnowflakeMap a
forall a b. (a -> b) -> a -> b
$ HashMap (Snowflake a) a
-> HashMap (Snowflake a) a -> HashMap (Snowflake a) a
forall k v w.
(Eq k, Hashable k) =>
HashMap k v -> HashMap k w -> HashMap k v
LH.intersection (SnowflakeMap a -> HashMap (Snowflake a) a
forall a. SnowflakeMap a -> HashMap (Snowflake a) a
unSnowflakeMap SnowflakeMap a
m) (SnowflakeMap a -> HashMap (Snowflake a) a
forall a. SnowflakeMap a -> HashMap (Snowflake a) a
unSnowflakeMap SnowflakeMap a
m')
{-# INLINABLE intersection #-}
intersectionWith :: (a -> a -> b) -> SnowflakeMap a -> SnowflakeMap a -> SnowflakeMap b
intersectionWith :: (a -> a -> b) -> SnowflakeMap a -> SnowflakeMap a -> SnowflakeMap b
intersectionWith f :: a -> a -> b
f m :: SnowflakeMap a
m m' :: SnowflakeMap a
m' = HashMap (Snowflake b) b -> SnowflakeMap b
forall a. HashMap (Snowflake a) a -> SnowflakeMap a
SnowflakeMap (HashMap (Snowflake b) b -> SnowflakeMap b)
-> (HashMap (Snowflake a) b -> HashMap (Snowflake b) b)
-> HashMap (Snowflake a) b
-> SnowflakeMap b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. HashMap (Snowflake a) b -> HashMap (Snowflake b) b
forall a v b. HashMap (Snowflake a) v -> HashMap (Snowflake b) v
coerceSnowflakeMap (HashMap (Snowflake a) b -> SnowflakeMap b)
-> HashMap (Snowflake a) b -> SnowflakeMap b
forall a b. (a -> b) -> a -> b
$ (a -> a -> b)
-> HashMap (Snowflake a) a
-> HashMap (Snowflake a) a
-> HashMap (Snowflake a) b
forall k v1 v2 v3.
(Eq k, Hashable k) =>
(v1 -> v2 -> v3) -> HashMap k v1 -> HashMap k v2 -> HashMap k v3
LH.intersectionWith a -> a -> b
f (SnowflakeMap a -> HashMap (Snowflake a) a
forall a. SnowflakeMap a -> HashMap (Snowflake a) a
unSnowflakeMap SnowflakeMap a
m) (SnowflakeMap a -> HashMap (Snowflake a) a
forall a. SnowflakeMap a -> HashMap (Snowflake a) a
unSnowflakeMap SnowflakeMap a
m')
{-# INLINABLE intersectionWith #-}
intersectionWithKey :: (Snowflake a -> a -> a -> b) -> SnowflakeMap a -> SnowflakeMap a -> SnowflakeMap b
intersectionWithKey :: (Snowflake a -> a -> a -> b)
-> SnowflakeMap a -> SnowflakeMap a -> SnowflakeMap b
intersectionWithKey f :: Snowflake a -> a -> a -> b
f m :: SnowflakeMap a
m m' :: SnowflakeMap a
m' = HashMap (Snowflake b) b -> SnowflakeMap b
forall a. HashMap (Snowflake a) a -> SnowflakeMap a
SnowflakeMap (HashMap (Snowflake b) b -> SnowflakeMap b)
-> (HashMap (Snowflake a) b -> HashMap (Snowflake b) b)
-> HashMap (Snowflake a) b
-> SnowflakeMap b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. HashMap (Snowflake a) b -> HashMap (Snowflake b) b
forall a v b. HashMap (Snowflake a) v -> HashMap (Snowflake b) v
coerceSnowflakeMap (HashMap (Snowflake a) b -> SnowflakeMap b)
-> HashMap (Snowflake a) b -> SnowflakeMap b
forall a b. (a -> b) -> a -> b
$ (Snowflake a -> a -> a -> b)
-> HashMap (Snowflake a) a
-> HashMap (Snowflake a) a
-> HashMap (Snowflake a) b
forall k v1 v2 v3.
(Eq k, Hashable k) =>
(k -> v1 -> v2 -> v3)
-> HashMap k v1 -> HashMap k v2 -> HashMap k v3
LH.intersectionWithKey Snowflake a -> a -> a -> b
f (SnowflakeMap a -> HashMap (Snowflake a) a
forall a. SnowflakeMap a -> HashMap (Snowflake a) a
unSnowflakeMap SnowflakeMap a
m) (SnowflakeMap a -> HashMap (Snowflake a) a
forall a. SnowflakeMap a -> HashMap (Snowflake a) a
unSnowflakeMap SnowflakeMap a
m')
{-# INLINABLE intersectionWithKey #-}
foldl' :: (a -> b -> a) -> a -> SnowflakeMap b -> a
foldl' :: (a -> b -> a) -> a -> SnowflakeMap b -> a
foldl' f :: a -> b -> a
f s :: a
s m :: SnowflakeMap b
m = (a -> b -> a) -> a -> HashMap (Snowflake b) b -> a
forall a v k. (a -> v -> a) -> a -> HashMap k v -> a
LH.foldl' a -> b -> a
f a
s (HashMap (Snowflake b) b -> a) -> HashMap (Snowflake b) b -> a
forall a b. (a -> b) -> a -> b
$ SnowflakeMap b -> HashMap (Snowflake b) b
forall a. SnowflakeMap a -> HashMap (Snowflake a) a
unSnowflakeMap SnowflakeMap b
m
{-# INLINABLE foldl' #-}
foldlWithKey' :: (a -> Snowflake b -> b -> a) -> a -> SnowflakeMap b -> a
foldlWithKey' :: (a -> Snowflake b -> b -> a) -> a -> SnowflakeMap b -> a
foldlWithKey' f :: a -> Snowflake b -> b -> a
f s :: a
s m :: SnowflakeMap b
m = (a -> Snowflake b -> b -> a) -> a -> HashMap (Snowflake b) b -> a
forall a k v. (a -> k -> v -> a) -> a -> HashMap k v -> a
LH.foldlWithKey' a -> Snowflake b -> b -> a
f a
s (HashMap (Snowflake b) b -> a) -> HashMap (Snowflake b) b -> a
forall a b. (a -> b) -> a -> b
$ SnowflakeMap b -> HashMap (Snowflake b) b
forall a. SnowflakeMap a -> HashMap (Snowflake a) a
unSnowflakeMap SnowflakeMap b
m
{-# INLINABLE foldlWithKey' #-}
foldr :: (b -> a -> a) -> a -> SnowflakeMap b -> a
foldr :: (b -> a -> a) -> a -> SnowflakeMap b -> a
foldr f :: b -> a -> a
f s :: a
s m :: SnowflakeMap b
m = (b -> a -> a) -> a -> HashMap (Snowflake b) b -> a
forall v a k. (v -> a -> a) -> a -> HashMap k v -> a
LH.foldr b -> a -> a
f a
s (HashMap (Snowflake b) b -> a) -> HashMap (Snowflake b) b -> a
forall a b. (a -> b) -> a -> b
$ SnowflakeMap b -> HashMap (Snowflake b) b
forall a. SnowflakeMap a -> HashMap (Snowflake a) a
unSnowflakeMap SnowflakeMap b
m
{-# INLINABLE foldr #-}
foldrWithKey :: (Snowflake b -> b -> a -> a) -> a -> SnowflakeMap b -> a
foldrWithKey :: (Snowflake b -> b -> a -> a) -> a -> SnowflakeMap b -> a
foldrWithKey f :: Snowflake b -> b -> a -> a
f s :: a
s m :: SnowflakeMap b
m = (Snowflake b -> b -> a -> a) -> a -> HashMap (Snowflake b) b -> a
forall k v a. (k -> v -> a -> a) -> a -> HashMap k v -> a
LH.foldrWithKey Snowflake b -> b -> a -> a
f a
s (HashMap (Snowflake b) b -> a) -> HashMap (Snowflake b) b -> a
forall a b. (a -> b) -> a -> b
$ SnowflakeMap b -> HashMap (Snowflake b) b
forall a. SnowflakeMap a -> HashMap (Snowflake a) a
unSnowflakeMap SnowflakeMap b
m
{-# INLINABLE foldrWithKey #-}
filter :: (a -> Bool) -> SnowflakeMap a -> SnowflakeMap a
filter :: (a -> Bool) -> SnowflakeMap a -> SnowflakeMap a
filter f :: a -> Bool
f = (HashMap (Snowflake a) a -> HashMap (Snowflake a) a)
-> SnowflakeMap a -> SnowflakeMap a
forall a b.
(HashMap (Snowflake a) a -> HashMap (Snowflake b) b)
-> SnowflakeMap a -> SnowflakeMap b
over ((HashMap (Snowflake a) a -> HashMap (Snowflake a) a)
-> SnowflakeMap a -> SnowflakeMap a)
-> (HashMap (Snowflake a) a -> HashMap (Snowflake a) a)
-> SnowflakeMap a
-> SnowflakeMap a
forall a b. (a -> b) -> a -> b
$ (a -> Bool) -> HashMap (Snowflake a) a -> HashMap (Snowflake a) a
forall v k. (v -> Bool) -> HashMap k v -> HashMap k v
LH.filter a -> Bool
f
{-# INLINABLE filter #-}
filterWithKey :: (Snowflake a -> a -> Bool) -> SnowflakeMap a -> SnowflakeMap a
filterWithKey :: (Snowflake a -> a -> Bool) -> SnowflakeMap a -> SnowflakeMap a
filterWithKey f :: Snowflake a -> a -> Bool
f = (HashMap (Snowflake a) a -> HashMap (Snowflake a) a)
-> SnowflakeMap a -> SnowflakeMap a
forall a b.
(HashMap (Snowflake a) a -> HashMap (Snowflake b) b)
-> SnowflakeMap a -> SnowflakeMap b
over ((HashMap (Snowflake a) a -> HashMap (Snowflake a) a)
-> SnowflakeMap a -> SnowflakeMap a)
-> (HashMap (Snowflake a) a -> HashMap (Snowflake a) a)
-> SnowflakeMap a
-> SnowflakeMap a
forall a b. (a -> b) -> a -> b
$ (Snowflake a -> a -> Bool)
-> HashMap (Snowflake a) a -> HashMap (Snowflake a) a
forall k v. (k -> v -> Bool) -> HashMap k v -> HashMap k v
LH.filterWithKey Snowflake a -> a -> Bool
f
{-# INLINABLE filterWithKey #-}
mapMaybe :: (a -> Maybe b) -> SnowflakeMap a -> SnowflakeMap b
mapMaybe :: (a -> Maybe b) -> SnowflakeMap a -> SnowflakeMap b
mapMaybe f :: a -> Maybe b
f = (HashMap (Snowflake a) a -> HashMap (Snowflake b) b)
-> SnowflakeMap a -> SnowflakeMap b
forall a b.
(HashMap (Snowflake a) a -> HashMap (Snowflake b) b)
-> SnowflakeMap a -> SnowflakeMap b
over ((HashMap (Snowflake a) a -> HashMap (Snowflake b) b)
-> SnowflakeMap a -> SnowflakeMap b)
-> (HashMap (Snowflake a) a -> HashMap (Snowflake b) b)
-> SnowflakeMap a
-> SnowflakeMap b
forall a b. (a -> b) -> a -> b
$ HashMap (Snowflake a) b -> HashMap (Snowflake b) b
forall a v b. HashMap (Snowflake a) v -> HashMap (Snowflake b) v
coerceSnowflakeMap (HashMap (Snowflake a) b -> HashMap (Snowflake b) b)
-> (HashMap (Snowflake a) a -> HashMap (Snowflake a) b)
-> HashMap (Snowflake a) a
-> HashMap (Snowflake b) b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (a -> Maybe b)
-> HashMap (Snowflake a) a -> HashMap (Snowflake a) b
forall v1 v2 k. (v1 -> Maybe v2) -> HashMap k v1 -> HashMap k v2
LH.mapMaybe a -> Maybe b
f
{-# INLINABLE mapMaybe #-}
mapMaybeWithKey :: (Snowflake a -> a -> Maybe b) -> SnowflakeMap a -> SnowflakeMap b
mapMaybeWithKey :: (Snowflake a -> a -> Maybe b) -> SnowflakeMap a -> SnowflakeMap b
mapMaybeWithKey f :: Snowflake a -> a -> Maybe b
f = (HashMap (Snowflake a) a -> HashMap (Snowflake b) b)
-> SnowflakeMap a -> SnowflakeMap b
forall a b.
(HashMap (Snowflake a) a -> HashMap (Snowflake b) b)
-> SnowflakeMap a -> SnowflakeMap b
over ((HashMap (Snowflake a) a -> HashMap (Snowflake b) b)
-> SnowflakeMap a -> SnowflakeMap b)
-> (HashMap (Snowflake a) a -> HashMap (Snowflake b) b)
-> SnowflakeMap a
-> SnowflakeMap b
forall a b. (a -> b) -> a -> b
$ HashMap (Snowflake a) b -> HashMap (Snowflake b) b
forall a v b. HashMap (Snowflake a) v -> HashMap (Snowflake b) v
coerceSnowflakeMap (HashMap (Snowflake a) b -> HashMap (Snowflake b) b)
-> (HashMap (Snowflake a) a -> HashMap (Snowflake a) b)
-> HashMap (Snowflake a) a
-> HashMap (Snowflake b) b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Snowflake a -> a -> Maybe b)
-> HashMap (Snowflake a) a -> HashMap (Snowflake a) b
forall k v1 v2.
(k -> v1 -> Maybe v2) -> HashMap k v1 -> HashMap k v2
LH.mapMaybeWithKey Snowflake a -> a -> Maybe b
f
{-# INLINABLE mapMaybeWithKey #-}
keys :: SnowflakeMap a -> [Snowflake a]
keys :: SnowflakeMap a -> [Snowflake a]
keys = HashMap (Snowflake a) a -> [Snowflake a]
forall k v. HashMap k v -> [k]
LH.keys (HashMap (Snowflake a) a -> [Snowflake a])
-> (SnowflakeMap a -> HashMap (Snowflake a) a)
-> SnowflakeMap a
-> [Snowflake a]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. SnowflakeMap a -> HashMap (Snowflake a) a
forall a. SnowflakeMap a -> HashMap (Snowflake a) a
unSnowflakeMap
{-# INLINABLE keys #-}
elems :: SnowflakeMap a -> [a]
elems :: SnowflakeMap a -> [a]
elems = HashMap (Snowflake a) a -> [a]
forall k v. HashMap k v -> [v]
LH.elems (HashMap (Snowflake a) a -> [a])
-> (SnowflakeMap a -> HashMap (Snowflake a) a)
-> SnowflakeMap a
-> [a]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. SnowflakeMap a -> HashMap (Snowflake a) a
forall a. SnowflakeMap a -> HashMap (Snowflake a) a
unSnowflakeMap
{-# INLINABLE elems #-}
toList :: SnowflakeMap a -> [(Snowflake a, a)]
toList :: SnowflakeMap a -> [(Snowflake a, a)]
toList = HashMap (Snowflake a) a -> [(Snowflake a, a)]
forall k v. HashMap k v -> [(k, v)]
LH.toList (HashMap (Snowflake a) a -> [(Snowflake a, a)])
-> (SnowflakeMap a -> HashMap (Snowflake a) a)
-> SnowflakeMap a
-> [(Snowflake a, a)]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. SnowflakeMap a -> HashMap (Snowflake a) a
forall a. SnowflakeMap a -> HashMap (Snowflake a) a
unSnowflakeMap
{-# INLINABLE toList #-}
fromList :: HasID' a => [a] -> SnowflakeMap a
fromList :: [a] -> SnowflakeMap a
fromList = HashMap (Snowflake a) a -> SnowflakeMap a
forall a. HashMap (Snowflake a) a -> SnowflakeMap a
SnowflakeMap (HashMap (Snowflake a) a -> SnowflakeMap a)
-> ([a] -> HashMap (Snowflake a) a) -> [a] -> SnowflakeMap a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [(Snowflake a, a)] -> HashMap (Snowflake a) a
forall k v. (Eq k, Hashable k) => [(k, v)] -> HashMap k v
LH.fromList ([(Snowflake a, a)] -> HashMap (Snowflake a) a)
-> ([a] -> [(Snowflake a, a)]) -> [a] -> HashMap (Snowflake a) a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (a -> (Snowflake a, a)) -> [a] -> [(Snowflake a, a)]
forall a b. (a -> b) -> [a] -> [b]
Prelude.map (\v :: a
v -> (a -> Snowflake a
forall b a. HasID b a => a -> Snowflake b
getID a
v, a
v))
{-# INLINABLE fromList #-}
fromListWith :: HasID' a => (a -> a -> a) -> [a] -> SnowflakeMap a
fromListWith :: (a -> a -> a) -> [a] -> SnowflakeMap a
fromListWith f :: a -> a -> a
f = HashMap (Snowflake a) a -> SnowflakeMap a
forall a. HashMap (Snowflake a) a -> SnowflakeMap a
SnowflakeMap (HashMap (Snowflake a) a -> SnowflakeMap a)
-> ([a] -> HashMap (Snowflake a) a) -> [a] -> SnowflakeMap a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (a -> a -> a) -> [(Snowflake a, a)] -> HashMap (Snowflake a) a
forall k v.
(Eq k, Hashable k) =>
(v -> v -> v) -> [(k, v)] -> HashMap k v
LH.fromListWith a -> a -> a
f ([(Snowflake a, a)] -> HashMap (Snowflake a) a)
-> ([a] -> [(Snowflake a, a)]) -> [a] -> HashMap (Snowflake a) a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (a -> (Snowflake a, a)) -> [a] -> [(Snowflake a, a)]
forall a b. (a -> b) -> [a] -> [b]
Prelude.map (\v :: a
v -> (a -> Snowflake a
forall b a. HasID b a => a -> Snowflake b
getID a
v, a
v))
{-# INLINABLE fromListWith #-}
instance (FromJSON a, HasID' a) => FromJSON (SnowflakeMap a) where
parseJSON :: Value -> Parser (SnowflakeMap a)
parseJSON = String
-> (Array -> Parser (SnowflakeMap a))
-> Value
-> Parser (SnowflakeMap a)
forall a. String -> (Array -> Parser a) -> Value -> Parser a
withArray "SnowflakeMap" ((Array -> Parser (SnowflakeMap a))
-> Value -> Parser (SnowflakeMap a))
-> (Array -> Parser (SnowflakeMap a))
-> Value
-> Parser (SnowflakeMap a)
forall a b. (a -> b) -> a -> b
$ \l :: Array
l -> do
Vector a
parsed <- (Value -> Parser a) -> Array -> Parser (Vector a)
forall (t :: * -> *) (f :: * -> *) a b.
(Traversable t, Applicative f) =>
(a -> f b) -> t a -> f (t b)
traverse Value -> Parser a
forall a. FromJSON a => Value -> Parser a
parseJSON Array
l
SnowflakeMap a -> Parser (SnowflakeMap a)
forall (f :: * -> *) a. Applicative f => a -> f a
pure (SnowflakeMap a -> Parser (SnowflakeMap a))
-> (Vector a -> SnowflakeMap a)
-> Vector a
-> Parser (SnowflakeMap a)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [a] -> SnowflakeMap a
forall a. HasID' a => [a] -> SnowflakeMap a
Calamity.Internal.SnowflakeMap.fromList ([a] -> SnowflakeMap a)
-> (Vector a -> [a]) -> Vector a -> SnowflakeMap a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Vector a -> [a]
forall (t :: * -> *) a. Foldable t => t a -> [a]
F.toList (Vector a -> Parser (SnowflakeMap a))
-> Vector a -> Parser (SnowflakeMap a)
forall a b. (a -> b) -> a -> b
$ Vector a
parsed
instance ToJSON a => ToJSON (SnowflakeMap a) where
toJSON :: SnowflakeMap a -> Value
toJSON = [a] -> Value
forall a. ToJSON a => a -> Value
toJSON ([a] -> Value)
-> (SnowflakeMap a -> [a]) -> SnowflakeMap a -> Value
forall b c a. (b -> c) -> (a -> b) -> a -> c
. SnowflakeMap a -> [a]
forall a. SnowflakeMap a -> [a]
elems
toEncoding :: SnowflakeMap a -> Encoding
toEncoding = [a] -> Encoding
forall a. ToJSON a => a -> Encoding
toEncoding ([a] -> Encoding)
-> (SnowflakeMap a -> [a]) -> SnowflakeMap a -> Encoding
forall b c a. (b -> c) -> (a -> b) -> a -> c
. SnowflakeMap a -> [a]
forall a. SnowflakeMap a -> [a]
elems