Safe Haskell | None |
---|---|
Language | Haskell2010 |
Data.GS1.Parser.Parser
Description
module providing parser helper functions
- getCursorsByName :: Name -> Cursor -> [Cursor]
- getTagContent :: Cursor -> Name -> [Text]
- parseSingleElem :: Text -> (Text -> Either ParseFailure a) -> [Text] -> Either ParseFailure a
- parseTimeXML :: Text -> [Text] -> Either ParseFailure EPCISTime
- parseTimeZoneXML :: Text -> [Text] -> Either ParseFailure TimeZone
- parseStr2TimeZone :: Text -> Either ParseFailure TimeZone
- isoFormats :: [String]
- getFirstJustTz :: Text -> [Maybe a] -> Either ParseFailure a
- parseStr2Time :: Text -> Either ParseFailure EPCISTime
- parseBizStep :: Cursor -> Either ParseFailure BizStep
- parseDisposition :: Cursor -> Either ParseFailure Disposition
- parseAction :: Cursor -> Either ParseFailure Action
- parseDWhen :: Cursor -> Either ParseFailure DWhen
- checkValidBizDisp :: Either ParseFailure BizStep -> Either ParseFailure Disposition -> Bool
- parseDWhy :: Cursor -> Either ParseFailure DWhy
- parseSourceDestLocation :: Cursor -> Name -> Name -> Name -> [Either ParseFailure SrcDestLocation]
- parseDWhere :: Cursor -> Either ParseFailure DWhere
- parseQuantity :: Cursor -> Maybe Quantity
- parseInstanceLabel :: Cursor -> [Either ParseFailure LabelEPC]
- parseClassLabel :: Cursor -> Either ParseFailure LabelEPC
- parseParentLabel :: Cursor -> Maybe ParentLabel
- parseLabelEPCs :: Name -> Name -> Cursor -> [Either ParseFailure LabelEPC]
- returnLeftErrors :: (Either ParseFailure Action, [[ParseFailure]]) -> ParseFailure
- parseObjectDWhat :: Cursor -> Either ParseFailure ObjectDWhat
- parseAggregationDWhat :: Cursor -> Either ParseFailure AggregationDWhat
- parseTransactionDWhat :: Cursor -> Either ParseFailure TransactionDWhat
- parseTransformationId :: Cursor -> Maybe TransformationId
- parseTransformationDWhat :: Cursor -> Either ParseFailure TransformationDWhat
- parseBizTransactionHelp :: (Text, Text) -> Either ParseFailure BizTransaction
- parseBizTransaction :: Cursor -> [Either ParseFailure BizTransaction]
- parseEventList :: EventType -> [(Maybe EventId, Either ParseFailure DWhat, Either ParseFailure DWhen, Either ParseFailure DWhy, Either ParseFailure DWhere)] -> [Either ParseFailure Event]
- parseEventId :: Cursor -> Either ParseFailure EventId
- parseDWhat :: EventType -> [Cursor] -> [Either ParseFailure DWhat]
- parseEventByType :: Cursor -> EventType -> [Either ParseFailure Event]
Documentation
getCursorsByName :: Name -> Cursor -> [Cursor] Source #
Get all the cursors with the given name below the current cursor
parseSingleElem :: Text -> (Text -> Either ParseFailure a) -> [Text] -> Either ParseFailure a Source #
parseTimeXML :: Text -> [Text] -> Either ParseFailure EPCISTime Source #
parseTimeZoneXML :: Text -> [Text] -> Either ParseFailure TimeZone Source #
parseStr2TimeZone :: Text -> Either ParseFailure TimeZone Source #
parse the T.Text and obtain TimeZone,
isoFormats :: [String] Source #
getFirstJustTz :: Text -> [Maybe a] -> Either ParseFailure a Source #
parseStr2Time :: Text -> Either ParseFailure EPCISTime Source #
parse the string to UTC time, the time zone information will be merged into the time tries the different ISO8601 formats and gets the first one that parses
parseBizStep :: Cursor -> Either ParseFailure BizStep Source #
Parse BizStep by Name
parseDisposition :: Cursor -> Either ParseFailure Disposition Source #
Parse Disposition by Name
parseAction :: Cursor -> Either ParseFailure Action Source #
Parse Action by Name
parseDWhen :: Cursor -> Either ParseFailure DWhen Source #
Requires Event Level cursor
checkValidBizDisp :: Either ParseFailure BizStep -> Either ParseFailure Disposition -> Bool Source #
parseSourceDestLocation :: Cursor -> Name -> Name -> Name -> [Either ParseFailure SrcDestLocation] Source #
TODO: there must be some more modification on it
c --> Can be a top level / event-level cursor list --> The Name of the cursor under which the list of epcs lie e.g -> sourceList, destinationList el --> The Name of cursor which has the epc string as its content e.g -> source, destination The content of this forms the LocationEPC attr --> The name of the attribute to look into for epc content, e.g, "type" The content found with this form the SourceDestTypes
parseDWhere :: Cursor -> Either ParseFailure DWhere Source #
parseParentLabel :: Cursor -> Maybe ParentLabel Source #
parse group of text to obtain ParentId takes in one event cursor, looks for a cursor that resembles
parseLabelEPCs :: Name -> Name -> Cursor -> [Either ParseFailure LabelEPC] Source #
returnLeftErrors :: (Either ParseFailure Action, [[ParseFailure]]) -> ParseFailure Source #
parseObjectDWhat :: Cursor -> Either ParseFailure ObjectDWhat Source #
parse and construct ObjectDWhat dimension
parseAggregationDWhat :: Cursor -> Either ParseFailure AggregationDWhat Source #
parse and construct AggregationDWhat dimension
parseBizTransaction :: Cursor -> [Either ParseFailure BizTransaction] Source #
BizTransactionList element
parseEventList :: EventType -> [(Maybe EventId, Either ParseFailure DWhat, Either ParseFailure DWhen, Either ParseFailure DWhy, Either ParseFailure DWhere)] -> [Either ParseFailure Event] Source #
parseDWhat :: EventType -> [Cursor] -> [Either ParseFailure DWhat] Source #
parseEventByType :: Cursor -> EventType -> [Either ParseFailure Event] Source #
Find all events (that match the specified EventType) and put them into an event list