aboutsummaryrefslogtreecommitdiffhomepage
path: root/core/src/Text/Edifact/Common/Composites.hs
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/Text/Edifact/Common/Composites.hs')
-rw-r--r--core/src/Text/Edifact/Common/Composites.hs135
1 files changed, 135 insertions, 0 deletions
diff --git a/core/src/Text/Edifact/Common/Composites.hs b/core/src/Text/Edifact/Common/Composites.hs
new file mode 100644
index 0000000..39f61e7
--- /dev/null
+++ b/core/src/Text/Edifact/Common/Composites.hs
@@ -0,0 +1,135 @@
1{-# LANGUAGE OverloadedStrings #-}
2
3module Text.Edifact.Common.Composites
4 ( compositeS001
5 , compositeS002
6 , compositeS003
7 , compositeS004
8 , compositeS005
9 , compositeS009
10 , compositeS010
11 ) where
12
13import Text.Edifact.Common.Simples (simple0001, simple0002,
14 simple0004, simple0007,
15 simple0008, simple0010,
16 simple0014, simple0017,
17 simple0019, simple0022,
18 simple0025, simple0042,
19 simple0046, simple0051,
20 simple0052, simple0054,
21 simple0057, simple0065,
22 simple0070, simple0073,
23 simple0080, simple0133)
24
25import Text.Edifact.Parsing
26import Text.Edifact.Types (Value)
27
28-- | Derived from this specification:
29--
30-- > 010 0001 Syntax identifier M a4
31-- > 020 0002 Syntax version number M an1
32-- > 030 0080 Service code list directory version number C an..6
33-- > 040 0133 Character encoding, coded C an..3
34--
35-- Dependencies: 'simple0001', 'simple0002', 'simple0080', 'simple0133'.
36compositeS001 :: Parser Value
37compositeS001 =
38 composite "S001"
39 [ "010" .@ mandatory simple0001
40 , "020" .@ mandatory simple0002
41 , "030" .@ optional simple0080
42 , "040" .@ optional simple0133
43 ]
44
45-- | Derived from this specification:
46--
47-- > 010 0004 Interchange sender identification M an..35
48-- > 020 0007 Identification code qualifier C an..4
49-- > 030 0008 Interchange sender internal identification C an..35
50-- > 040 0042 Interchange sender internal sub-identification C an..35
51--
52-- Dependencies: 'simple0004', 'simple0007', 'simple0008', 'simple0042'.
53compositeS002 :: Parser Value
54compositeS002 =
55 composite "S002"
56 [ "010" .@ mandatory simple0004
57 , "020" .@ optional simple0007
58 , "030" .@ optional simple0008
59 , "040" .@ optional simple0042
60 ]
61
62-- | Derived from this specification:
63--
64-- > 010 0010 Interchange recipient identification M an..35
65-- > 020 0007 Identification code qualifier C an..4
66-- > 030 0014 Interchange recipient internal identification C an..35
67-- > 040 0046 Interchange recipient internal sub-identification C an..35
68--
69-- Dependencies: 'simple0007', 'simple0010', 'simple0014', 'simple0046'.
70compositeS003 :: Parser Value
71compositeS003 =
72 composite "S003"
73 [ "010" .@ mandatory simple0010
74 , "020" .@ optional simple0007
75 , "030" .@ optional simple0014
76 , "040" .@ optional simple0046
77 ]
78
79-- | Derived from this specification:
80--
81-- > 010 0017 Date M n6
82-- > 020 0019 Time M n4
83--
84-- Dependencies: 'simple0017', 'simple0019'.
85compositeS004 :: Parser Value
86compositeS004 =
87 composite "S004"
88 [ "010" .@ mandatory simple0017
89 , "020" .@ mandatory simple0019
90 ]
91
92-- | Derived from this specification:
93--
94-- > 010 0022 Recipient reference/password M an..14
95-- > 020 0025 Recipient reference/password qualifier C an2
96--
97-- Dependencies: 'simple0022', 'simple0025'.
98compositeS005 :: Parser Value
99compositeS005 =
100 composite "S005"
101 [ "010" .@ mandatory simple0022
102 , "020" .@ optional simple0025
103 ]
104
105-- | Derived from this specification:
106--
107-- > 010 0065 Message type M an..6
108-- > 020 0052 Message version number M an..3
109-- > 030 0054 Message release number M an..3
110-- > 040 0051 Controlling agency M an..2
111-- > 050 0057 Association assigned code C an..6
112--
113-- Dependencies: 'simple0051', 'simple0052', 'simple0054', 'simple0057', 'simple0065'.
114compositeS009 :: Parser Value
115compositeS009 =
116 composite "S009"
117 [ "010" .@ mandatory simple0065
118 , "020" .@ mandatory simple0052
119 , "030" .@ mandatory simple0054
120 , "040" .@ mandatory simple0051
121 , "050" .@ optional simple0057
122 ]
123
124-- | Derived from this specification:
125--
126-- > 010 0070 Sequence of transfers M n..2
127-- > 020 0073 First and last transfer C a1
128--
129-- Dependencies: 'simple0070', 'simple0073'.
130compositeS010 :: Parser Value
131compositeS010 =
132 composite "S010"
133 [ "010" .@ mandatory simple0070
134 , "020" .@ optional simple0073
135 ]