diff options
Diffstat (limited to 'scaffolder/src/Text/Edifact/BundleReader/Configuration.hs')
-rw-r--r-- | scaffolder/src/Text/Edifact/BundleReader/Configuration.hs | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/scaffolder/src/Text/Edifact/BundleReader/Configuration.hs b/scaffolder/src/Text/Edifact/BundleReader/Configuration.hs new file mode 100644 index 0000000..0609c03 --- /dev/null +++ b/scaffolder/src/Text/Edifact/BundleReader/Configuration.hs | |||
@@ -0,0 +1,30 @@ | |||
1 | {-# LANGUAGE FlexibleContexts #-} | ||
2 | |||
3 | module Text.Edifact.BundleReader.Configuration | ||
4 | ( -- * Parsing environment | ||
5 | BundleReaderEnv(..) | ||
6 | -- * Shortcuts for reading the environment | ||
7 | , getTargetRevision | ||
8 | , getHome | ||
9 | ) where | ||
10 | |||
11 | import Text.Edifact.Scaffolder.Commons (MessageCode, Revision) | ||
12 | |||
13 | import Control.Monad.Reader.Class (MonadReader, asks) | ||
14 | |||
15 | data BundleReaderEnv = BundleReaderEnv { parserRevision :: Revision | ||
16 | , specificationHome :: FilePath | ||
17 | , bundle :: [FilePath] | ||
18 | , messageNames :: [MessageCode] | ||
19 | , messagesFiles :: [FilePath] | ||
20 | , segmentsFiles :: [FilePath] | ||
21 | , compositesFiles :: [FilePath] | ||
22 | , simplesFiles :: [FilePath] | ||
23 | , codedSimplesFiles :: [FilePath] | ||
24 | } | ||
25 | |||
26 | getTargetRevision :: MonadReader BundleReaderEnv m => m Revision | ||
27 | getTargetRevision = asks parserRevision | ||
28 | |||
29 | getHome :: MonadReader BundleReaderEnv m => m FilePath | ||
30 | getHome = asks specificationHome | ||