| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Hasql.Interpolate.Internal.Encoder
Synopsis
- class EncodeValue a where
- encodeValue :: Value a
- class EncodeField a where
Documentation
class EncodeValue a where Source #
This type class determines which encoder we will apply to a field by its type.
Example
data ThreatLevel = None | Midnight
instance EncodeValue ThreatLevel where
encodeValue = enum \case
None -> "none"
Midnight -> "midnight"
Methods
encodeValue :: Value a Source #
Instances
class EncodeField a where Source #
You do not need to define instances for this class; The two
instances exported here cover all uses. The class only exists to
lift Value to hasql's NullableOrNot GADT.
Methods
encodeField :: NullableOrNot Value a Source #
Instances
| EncodeValue a => EncodeField a Source # | Overlappable instance for all non-nullable types. |
Defined in Hasql.Interpolate.Internal.Encoder Methods encodeField :: NullableOrNot Value a Source # | |
| EncodeValue a => EncodeField (Maybe a) Source # | Instance for all nullable types. |
Defined in Hasql.Interpolate.Internal.Encoder Methods encodeField :: NullableOrNot Value (Maybe a) Source # | |