2 Module : Text.Edifact.Parsing
3 Description : Parsing routines and combinators
5 This module is there to reexport most of the combinators and helpers required
6 to parse an Edifact payload.
8 For high level combinators, have a look at "Text.Edifact.Parsing.Combinators".
10 For low level combinators, have a look at "Text.Edifact.Parsing.Primitives".
12 module Text.Edifact.Parsing
18 -- | See "Text.Edifact.Parsing.Combinators" for more details
27 -- ** Position and strictness
34 -- ** Repetition of segments and segment groups
41 -- | See "Text.Edifact.Parsing.Primitives" for more details and known limitations.
43 -- ** Simple elements definition
58 import Text.Edifact.Parsing.Combinators (composite, mandatory,
59 maybeOnce, message, once,
60 optional, position, repeated,
61 repeatedAtLeastOnce, segment,
62 segmentGroup, simple, (.@),
64 import Text.Edifact.Parsing.Commons (Parser, defaultContext)
65 import Text.Edifact.Parsing.Primitives (alpha, alphaNumeric, exactly,
68 import Data.Text (Text)
69 import Text.Parsec (ParseError, runParser)
71 parse :: Parser value -> Text -> Either ParseError value
72 parse p = runParser p defaultContext ""