Safe Haskell | None |
---|---|
Language | Haskell2010 |
Calamity.Types.Snowflake
Description
The snowflake type
Synopsis
- newtype Snowflake t = 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
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
HasField' field a (Snowflake b) => HasID (b :: k) (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
HasField' field a (Snowflake c) => HasID (b :: k1) (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 #