]> git.immae.eu Git - github/fretlink/edi-parser.git/blame - scaffolder/src/Text/Edifact/BundleReader/Configuration.hs
Release code as open source
[github/fretlink/edi-parser.git] / scaffolder / src / Text / Edifact / BundleReader / Configuration.hs
CommitLineData
a9d77a20
FM
1{-# LANGUAGE FlexibleContexts #-}
2
3module Text.Edifact.BundleReader.Configuration
4 ( -- * Parsing environment
5 BundleReaderEnv(..)
6 -- * Shortcuts for reading the environment
7 , getTargetRevision
8 , getHome
9 ) where
10
11import Text.Edifact.Scaffolder.Commons (MessageCode, Revision)
12
13import Control.Monad.Reader.Class (MonadReader, asks)
14
15data 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
26getTargetRevision :: MonadReader BundleReaderEnv m => m Revision
27getTargetRevision = asks parserRevision
28
29getHome :: MonadReader BundleReaderEnv m => m FilePath
30getHome = asks specificationHome