simmsb/calamity

Refactor HasID typeclass

Closed this issue · 0 comments

Instead of HasID a only having a single output type, allow it to work for types that contain multiple IDs, so:

class HasID a b where
    getID :: a -> Snowflake b

instance HasID Message Message where
    getID = view #id

instance HasID Message Channel where
    getID = view #channelID