calamity-0.1.12.0: A library for writing discord bots
Safe HaskellNone
LanguageHaskell2010

Calamity.Internal.SnowflakeMap

Description

Module for custom instance of Data.HashMap.Lazy that decodes from any list of objects that have an id field

Documentation

newtype SnowflakeMap a Source #

Constructors

SnowflakeMap 

Fields

Instances

Instances details
Functor SnowflakeMap Source # 
Instance details

Defined in Calamity.Internal.SnowflakeMap

Methods

fmap :: (a -> b) -> SnowflakeMap a -> SnowflakeMap b #

(<$) :: a -> SnowflakeMap b -> SnowflakeMap a #

Foldable SnowflakeMap Source # 
Instance details

Defined in Calamity.Internal.SnowflakeMap

Methods

fold :: Monoid m => SnowflakeMap m -> m #

foldMap :: Monoid m => (a -> m) -> SnowflakeMap a -> m #

foldMap' :: Monoid m => (a -> m) -> SnowflakeMap a -> m #

foldr :: (a -> b -> b) -> b -> SnowflakeMap a -> b #

foldr' :: (a -> b -> b) -> b -> SnowflakeMap a -> b #

foldl :: (b -> a -> b) -> b -> SnowflakeMap a -> b #

foldl' :: (b -> a -> b) -> b -> SnowflakeMap a -> b #

foldr1 :: (a -> a -> a) -> SnowflakeMap a -> a #

foldl1 :: (a -> a -> a) -> SnowflakeMap a -> a #

toList :: SnowflakeMap a -> [a] #

null :: SnowflakeMap a -> Bool #

length :: SnowflakeMap a -> Int #

elem :: Eq a => a -> SnowflakeMap a -> Bool #

maximum :: Ord a => SnowflakeMap a -> a #

minimum :: Ord a => SnowflakeMap a -> a #

sum :: Num a => SnowflakeMap a -> a #

product :: Num a => SnowflakeMap a -> a #

Traversable SnowflakeMap Source # 
Instance details

Defined in Calamity.Internal.SnowflakeMap

Methods

traverse :: Applicative f => (a -> f b) -> SnowflakeMap a -> f (SnowflakeMap b) #

sequenceA :: Applicative f => SnowflakeMap (f a) -> f (SnowflakeMap a) #

mapM :: Monad m => (a -> m b) -> SnowflakeMap a -> m (SnowflakeMap b) #

sequence :: Monad m => SnowflakeMap (m a) -> m (SnowflakeMap a) #

HasField' "permissionOverwrites" GuildChannel (SnowflakeMap Overwrite) 
Instance details

Defined in Calamity.Types.Model.Channel.Guild

IsList (SnowflakeMap a) Source # 
Instance details

Defined in Calamity.Internal.SnowflakeMap

Associated Types

type Item (SnowflakeMap a) #

Eq a => Eq (SnowflakeMap a) Source # 
Instance details

Defined in Calamity.Internal.SnowflakeMap

Data a => Data (SnowflakeMap a) Source # 
Instance details

Defined in Calamity.Internal.SnowflakeMap

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> SnowflakeMap a -> c (SnowflakeMap a) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (SnowflakeMap a) #

toConstr :: SnowflakeMap a -> Constr #

dataTypeOf :: SnowflakeMap a -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (SnowflakeMap a)) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (SnowflakeMap a)) #

gmapT :: (forall b. Data b => b -> b) -> SnowflakeMap a -> SnowflakeMap a #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> SnowflakeMap a -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> SnowflakeMap a -> r #

gmapQ :: (forall d. Data d => d -> u) -> SnowflakeMap a -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> SnowflakeMap a -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> SnowflakeMap a -> m (SnowflakeMap a) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> SnowflakeMap a -> m (SnowflakeMap a) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> SnowflakeMap a -> m (SnowflakeMap a) #

Ord a => Ord (SnowflakeMap a) Source # 
Instance details

Defined in Calamity.Internal.SnowflakeMap

Show a => Show (SnowflakeMap a) Source # 
Instance details

Defined in Calamity.Internal.SnowflakeMap

Generic (SnowflakeMap a) Source # 
Instance details

Defined in Calamity.Internal.SnowflakeMap

Associated Types

type Rep (SnowflakeMap a) :: Type -> Type #

Methods

from :: SnowflakeMap a -> Rep (SnowflakeMap a) x #

to :: Rep (SnowflakeMap a) x -> SnowflakeMap a #

Semigroup (SnowflakeMap a) Source # 
Instance details

Defined in Calamity.Internal.SnowflakeMap

Monoid (SnowflakeMap a) Source # 
Instance details

Defined in Calamity.Internal.SnowflakeMap

NFData a => NFData (SnowflakeMap a) Source # 
Instance details

Defined in Calamity.Internal.SnowflakeMap

Methods

rnf :: SnowflakeMap a -> () #

Show a => TextShow (SnowflakeMap a) Source # 
Instance details

Defined in Calamity.Internal.SnowflakeMap

(FromJSON a, HasID' a) => FromJSON (SnowflakeMap a) Source # 
Instance details

Defined in Calamity.Internal.SnowflakeMap

Methods

parseJSON :: Value -> Parser (SnowflakeMap a)

parseJSONList :: Value -> Parser [SnowflakeMap a]

ToJSON a => ToJSON (SnowflakeMap a) Source # 
Instance details

Defined in Calamity.Internal.SnowflakeMap

Methods

toJSON :: SnowflakeMap a -> Value

toEncoding :: SnowflakeMap a -> Encoding

toJSONList :: [SnowflakeMap a] -> Value

toEncodingList :: [SnowflakeMap a] -> Encoding

Hashable a => Hashable (SnowflakeMap a) Source # 
Instance details

Defined in Calamity.Internal.SnowflakeMap

At (SnowflakeMap a) Source # 
Instance details

Defined in Calamity.Internal.SnowflakeMap

Methods

at :: Index (SnowflakeMap a) -> Lens' (SnowflakeMap a) (Maybe (IxValue (SnowflakeMap a)))

Ixed (SnowflakeMap a) Source # 
Instance details

Defined in Calamity.Internal.SnowflakeMap

Methods

ix :: Index (SnowflakeMap a) -> Traversal' (SnowflakeMap a) (IxValue (SnowflakeMap a))

Wrapped (SnowflakeMap a) Source # 
Instance details

Defined in Calamity.Internal.SnowflakeMap

Associated Types

type Unwrapped (SnowflakeMap a)

Methods

_Wrapped' :: Iso' (SnowflakeMap a) (Unwrapped (SnowflakeMap a))

SnowflakeMap a ~ t => Rewrapped (SnowflakeMap b) a Source # 
Instance details

Defined in Calamity.Internal.SnowflakeMap

type Rep (SnowflakeMap a) Source # 
Instance details

Defined in Calamity.Internal.SnowflakeMap

type Rep (SnowflakeMap a) = D1 ('MetaData "SnowflakeMap" "Calamity.Internal.SnowflakeMap" "calamity-0.1.12.0-inplace" 'True) (C1 ('MetaCons "SnowflakeMap" 'PrefixI 'True) (S1 ('MetaSel ('Just "unSnowflakeMap") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (HashMap (Snowflake a) a))))
type Item (SnowflakeMap a) Source # 
Instance details

Defined in Calamity.Internal.SnowflakeMap

type Item (SnowflakeMap a) = Item (HashMap (Snowflake a) a)
type Index (SnowflakeMap a) Source # 
Instance details

Defined in Calamity.Internal.SnowflakeMap

type Index (SnowflakeMap a) = Snowflake a
type IxValue (SnowflakeMap a) Source # 
Instance details

Defined in Calamity.Internal.SnowflakeMap

type IxValue (SnowflakeMap a) = a
type Unwrapped (SnowflakeMap a) Source # 
Instance details

Defined in Calamity.Internal.SnowflakeMap

type Unwrapped (SnowflakeMap a) = HashMap (Snowflake a) a

over :: (HashMap (Snowflake a) a -> HashMap (Snowflake b) b) -> SnowflakeMap a -> SnowflakeMap b Source #

coerceSnowflakeMap :: HashMap (Snowflake a) v -> HashMap (Snowflake b) v Source #

insertWith :: HasID' a => (a -> a -> a) -> a -> SnowflakeMap a -> SnowflakeMap a Source #

adjust :: (a -> a) -> Snowflake a -> SnowflakeMap a -> SnowflakeMap a Source #

unionWith :: (a -> a -> a) -> SnowflakeMap a -> SnowflakeMap a -> SnowflakeMap a Source #

unionWithKey :: (Snowflake a -> a -> a -> a) -> SnowflakeMap a -> SnowflakeMap a -> SnowflakeMap a Source #

map :: (a1 -> a2) -> SnowflakeMap a1 -> SnowflakeMap a2 Source #

mapWithKey :: (Snowflake a1 -> a1 -> a2) -> SnowflakeMap a1 -> SnowflakeMap a2 Source #

traverseWithKey :: Applicative f => (Snowflake a1 -> a1 -> f a2) -> SnowflakeMap a1 -> f (SnowflakeMap a2) Source #

foldl' :: (a -> b -> a) -> a -> SnowflakeMap b -> a Source #

foldlWithKey' :: (a -> Snowflake b -> b -> a) -> a -> SnowflakeMap b -> a Source #

foldr :: (b -> a -> a) -> a -> SnowflakeMap b -> a Source #

foldrWithKey :: (Snowflake b -> b -> a -> a) -> a -> SnowflakeMap b -> a Source #

fromListWith :: HasID' a => (a -> a -> a) -> [a] -> SnowflakeMap a Source #