Safe Haskell | None |
---|
Data.Bson
- class ToBson a where
- class FromBson a where
- data Parser a
- parse :: (a -> Parser b) -> a -> Result b
- parseMaybe :: (a -> Parser b) -> a -> Maybe b
- parseEither :: (a -> Parser b) -> a -> Either String b
- data RegexOption
- type RegexOptions = BitSet RegexOption
- data Value
- = ValueDouble !Double
- | ValueString !Text
- | ValueDocument !Document
- | ValueArray !Array
- | ValueBinary !Binary
- | ValueObjectId !ObjectId
- | ValueBool !Bool
- | ValueUtcTime !UTCTime
- | ValueNull
- | ValueRegex !Text !RegexOptions
- | ValueJavascript !Text
- | ValueJavascriptWithScope !Text !Document
- | ValueInt32 !Int32
- | ValueInt64 !Int64
- | ValueTimestamp !Int64
- | ValueMin
- | ValueMax
- data Binary
- = BinaryGeneric !ByteString
- | BinaryFunction !ByteString
- | BinaryUuid !UUID
- | BinaryMd5 !ByteString
- | BinaryUserDefined !ByteString
- data ObjectId = ObjectId {
- objectIdTime :: !Word32
- objectIdMachine :: !Word24
- objectIdPid :: !Word16
- objectIdInc :: !Word24
- data Document
- type Array = Vector Value
- type Label = Text
- type Field = (Label, Value)
- document :: [Field] -> Document
- (!?) :: FromBson a => Document -> Label -> Parser a
- (=:) :: ToBson a => Label -> a -> Field
Documentation
A continuation-based parser type.
parseEither :: (a -> Parser b) -> a -> Either String bSource
data RegexOption Source
Options for ValueRegex
, constructors order is important because
it's binary representation should be encoded in alphabetical order.
Constructors
RegexOptionCaseInsensitive | |
RegexOptionLocaleDependent | |
RegexOptionMultiline | |
RegexOptionDotall | |
RegexOptionUnicode | |
RegexOptionVerbose |
Instances
type RegexOptions = BitSet RegexOptionSource
A value is one of the following types of values
Constructors
Constructors
BinaryGeneric !ByteString | |
BinaryFunction !ByteString | |
BinaryUuid !UUID | |
BinaryMd5 !ByteString | |
BinaryUserDefined !ByteString |
Constructors
ObjectId | |
Fields
|