| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
PostgresqlTypes.Bit
Contents
Synopsis
- data Bit (numBits :: Nat)
- toBoolList :: forall (numBits :: Nat). KnownNat numBits => Bit numBits -> [Bool]
- toBoolVector :: forall (numBits :: Nat) vec. (KnownNat numBits, Vector vec Bool) => Bit numBits -> vec Bool
- refineFromBoolList :: forall (numBits :: Nat). KnownNat numBits => [Bool] -> Maybe (Bit numBits)
- normalizeFromBoolList :: forall (numBits :: Nat). KnownNat numBits => [Bool] -> Bit numBits
- refineFromBoolVector :: forall (numBits :: Nat) vec. (KnownNat numBits, Vector vec Bool) => vec Bool -> Maybe (Bit numBits)
- normalizeFromBoolVector :: forall (numBits :: Nat) vec. (KnownNat numBits, Vector vec Bool) => vec Bool -> Bit numBits
Documentation
data Bit (numBits :: Nat) Source #
PostgreSQL bit type. Fixed-length bit string.
The type parameter numBits specifies the static length of the bit string.
Only bit strings with exactly this length can be represented by this type.
Instances
| KnownNat numBits => Arbitrary (Bit numBits) Source # | |
| KnownNat numBits => IsString (Bit numBits) Source # | |
Defined in PostgresqlTypes.Bit Methods fromString :: String -> Bit numBits # | |
| KnownNat numBits => Read (Bit numBits) Source # | |
| KnownNat numBits => Show (Bit numBits) Source # | |
| Eq (Bit numBits) Source # | |
| Ord (Bit numBits) Source # | |
Defined in PostgresqlTypes.Bit | |
| Hashable (Bit numBits) Source # | |
Defined in PostgresqlTypes.Bit | |
| KnownNat numBits => IsScalar (Bit numBits) Source # | |
Defined in PostgresqlTypes.Bit Methods schemaName :: Tagged (Bit numBits) (Maybe Text) # typeName :: Tagged (Bit numBits) Text # baseOid :: Tagged (Bit numBits) (Maybe Word32) # arrayOid :: Tagged (Bit numBits) (Maybe Word32) # typeParams :: Tagged (Bit numBits) [Text] # typeSignature :: Tagged (Bit numBits) Text # binaryEncoder :: Bit numBits -> Write # binaryDecoder :: Variable (Either DecodingError (Bit numBits)) # textualEncoder :: Bit numBits -> TextBuilder # textualDecoder :: Parser (Bit numBits) # | |
Accessors
toBoolList :: forall (numBits :: Nat). KnownNat numBits => Bit numBits -> [Bool] Source #
Extract the bit string as a list of Bool.
toBoolVector :: forall (numBits :: Nat) vec. (KnownNat numBits, Vector vec Bool) => Bit numBits -> vec Bool Source #
Extract the bit string as any vector of Bool.
Constructors
refineFromBoolList :: forall (numBits :: Nat). KnownNat numBits => [Bool] -> Maybe (Bit numBits) Source #
normalizeFromBoolList :: forall (numBits :: Nat). KnownNat numBits => [Bool] -> Bit numBits Source #
Construct a PostgreSQL Bit from a list of Bool.
Truncates or pads to match the type-level length.