| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Calamity.Types.Snowflake
Description
The snowflake type
Synopsis
- newtype Snowflake (t :: Type) = Snowflake {}
- class HasID b a where
- type HasID' a = HasID a a
- newtype HasIDField field a = HasIDField a
- newtype HasIDFieldCoerce field a c = HasIDFieldCoerce a
- type HasIDFieldCoerce' field a = HasIDFieldCoerce field a a
- coerceSnowflake :: Snowflake a -> Snowflake b
Documentation
newtype Snowflake (t :: Type) Source #
Constructors
| Snowflake | |
Fields | |
Instances
class HasID b a where Source #
A typeclass for types that contain snowflakes of type b
Instances
newtype HasIDField field a Source #
A newtype wrapper for deriving HasID generically
Constructors
| HasIDField a |
Instances
| (HasID b c, HasField' field a c) => HasID b (HasIDField field a) Source # | |
Defined in Calamity.Types.Snowflake Methods getID :: HasIDField field a -> Snowflake b Source # | |
newtype HasIDFieldCoerce field a c Source #
A data a which contains an ID of type `Snowflake c`
which should be swapped with `Snowflake b` upon fetching
Constructors
| HasIDFieldCoerce a |
Instances
| (HasID c d, HasField' field a d) => HasID b (HasIDFieldCoerce field a c) Source # | |
Defined in Calamity.Types.Snowflake Methods getID :: HasIDFieldCoerce field a c -> Snowflake b Source # | |
type HasIDFieldCoerce' field a = HasIDFieldCoerce field a a Source #
coerceSnowflake :: Snowflake a -> Snowflake b Source #