diff options
Diffstat (limited to 'scaffolder/src/Text/Edifact/Scaffolder/Composites/Implementation.hs')
-rw-r--r-- | scaffolder/src/Text/Edifact/Scaffolder/Composites/Implementation.hs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/scaffolder/src/Text/Edifact/Scaffolder/Composites/Implementation.hs b/scaffolder/src/Text/Edifact/Scaffolder/Composites/Implementation.hs new file mode 100644 index 0000000..0f3e939 --- /dev/null +++ b/scaffolder/src/Text/Edifact/Scaffolder/Composites/Implementation.hs | |||
@@ -0,0 +1,19 @@ | |||
1 | {-# LANGUAGE OverloadedStrings #-} | ||
2 | |||
3 | module Text.Edifact.Scaffolder.Composites.Implementation | ||
4 | ( -- * | ||
5 | toImplementation | ||
6 | ) where | ||
7 | |||
8 | import Text.Edifact.Scaffolder.Commons | ||
9 | import Text.Edifact.Scaffolder.Composites.Types | ||
10 | |||
11 | import Data.List.NonEmpty as NE (toList) | ||
12 | import Formatting | ||
13 | |||
14 | toImplementation :: NonEmpty Dependency -> [Text] | ||
15 | toImplementation = haskellList . fmap callDependency . NE.toList | ||
16 | |||
17 | callDependency :: Dependency -> Text | ||
18 | callDependency (Dependency pos element presence) = | ||
19 | sformat (quoted fPosition % " .@ " % fPresence % " " % fElement) pos presence element | ||