on master help sign in
Document DBEnum
commit32395d07b0540ac93c43f7589315375b423c4775 authorOllie Charles <ollie@ocharles.org.uk> dateFri 18 Jun 2021, 10:52 (5 years ago) parent7133ace
1 file changed+5
src/Rel8/Type/Enum.hs+5
src/Rel8/Type/Enum.hs+5
@@ -91,11 +91,16 @@ instance DBEnum a => DBMax (Enum a)
9191instance DBEnum a => DBMin (Enum a)
9292
9393
94+-- | @DBEnum@ contains the necessary metadata to describe a PostgreSQL @enum@ type.
9495type DBEnum :: Type -> Constraint
9596class (DBType a, Enumable a) => DBEnum a where
97+ -- | Map Haskell values to the corresponding element of the @enum@ type. The
98+ -- default implementation of this method will use the exact name of the
99+ -- Haskell constructors.
96100 enumValue :: a -> String
97101 enumValue = gshow @(Rep a) . from
98102
103+ -- | The name of the PostgreSQL @enum@ type that @a@ maps to.
99104 enumTypeName :: String
100105
101106