| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
DataFrame.Operations.Inference
Description
Single-pass sampled inference lattice (Round-2 S2). One walk over the sampled cells maintains a candidate mask {Bool, Int, Double, Date} cleared by attempting the WS-B byte parsers; the assumption is the highest-priority surviving candidate. Shared by every reader (audit T1), together with the Int -> Double prefix promotion that replaces the full-column retry chain (audit T2).
Synopsis
- type DateFormat = String
- data ParsingAssumption
- makeParsingAssumption :: DateFormat -> Vector (Maybe Text) -> ParsingAssumption
- makeParsingAssumptionBytes :: DateFormat -> Vector (Maybe ByteString) -> ParsingAssumption
- byteStringDateParser :: DateFormat -> ByteString -> Maybe Day
- parseTimeOpt :: DateFormat -> Text -> Maybe Day
- promoteIntColumn :: (Int -> src -> Bool) -> (src -> Maybe Int) -> (src -> Maybe Double) -> Vector src -> Maybe Column
- promoteIntColumnIndexed :: Int -> (Int -> Bool) -> (Int -> Maybe Int) -> (Int -> Maybe Double) -> Maybe Column
- readIntStrict :: Text -> Maybe Int
Documentation
type DateFormat = String Source #
data ParsingAssumption Source #
Constructors
| BoolAssumption | |
| IntAssumption | |
| DoubleAssumption | |
| DateAssumption | |
| NoAssumption | |
| TextAssumption |
Instances
| Show ParsingAssumption Source # | |
Defined in DataFrame.Operations.Inference Methods showsPrec :: Int -> ParsingAssumption -> ShowS # show :: ParsingAssumption -> String # showList :: [ParsingAssumption] -> ShowS # | |
| Eq ParsingAssumption Source # | |
Defined in DataFrame.Operations.Inference Methods (==) :: ParsingAssumption -> ParsingAssumption -> Bool # (/=) :: ParsingAssumption -> ParsingAssumption -> Bool # | |
makeParsingAssumption :: DateFormat -> Vector (Maybe Text) -> ParsingAssumption Source #
Classify a sample of decoded Text cells (Nothing = null).
Bool/Int/Double candidates are tested with the WS-B byte parsers on
the UTF-8 bytes (strip-tolerant, overflow-rejecting); the Date
candidate keeps parseTimeOpt so custom formats behave exactly as
before. The walk exits early once every candidate is cleared.
makeParsingAssumptionBytes :: DateFormat -> Vector (Maybe ByteString) -> ParsingAssumption Source #
Byte-level twin of makeParsingAssumption for raw field bytes.
byteStringDateParser :: DateFormat -> ByteString -> Maybe Day Source #
The default %Y-%m-%d format takes the WS-B byte-level fast path;
custom formats keep the reference readByteStringDate parser.
parseTimeOpt :: DateFormat -> Text -> Maybe Day Source #
promoteIntColumn :: (Int -> src -> Bool) -> (src -> Maybe Int) -> (src -> Maybe Double) -> Vector src -> Maybe Column Source #
Fused Int pass with in-place promotion (audit T2): on the first
non-null cell that fails Int but parses as Double, the built Int prefix
is converted by a vector map and the pass continues as Double over the
retained raw cells. Nothing = some cell parses as neither (the caller
demotes the column to Text). Null slots hold sentinels (0 / 0.0)
guarded by the bitmap, exactly like the unpromoted passes.