-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Extension to Show: templating, catalogizing, languages, parameters, etc. -- -- "PCLT" is an abbreviation for "Parametric Composable Localizable -- Templates" - in fact it should also hold Detalizable. Term -- "Detailizable content (message)" in this package has a following -- meaning: some content, representing which it is possible to regulate, -- in how much details it is represented. -- -- Conceptually, this package is a powerful extension to the well known -- Show class, that (extension) is thought to be embeded in any Haskell -- program, which requires multilanguage support, and/or where messages -- should be detailizable. -- -- The PCLT catalog consists of: -- -- -- -- Each catalog entry (localizable template) consists of -- -- -- -- Each localized template is a sequence of chunks: -- -- -- -- To make a message one needs to specify -- -- -- -- The last two fields (localizable template ID + a map of parameters -- together with their values) is called instaniation (of templated -- message). In the program it wrapped in a PCSI data type. -- -- A parameter value may be -- -- -- -- This package comes together with another one - a dependent package -- PCLT-DB (section Database), which provides -- -- -- -- IMPORTANT!!! : It is highly recommended to use ISO 639(3) -- standard for language names, since PCLT-DB package is oriented on 3 -- letters (not bigger) language names. Without modifications PCLT-DB -- won't work for bigger (then 3-letters) names. -- -- ToDo considerations for the next versions: -- --
    --
  1. Consider using state monad in order to put catalog into an -- implicit context... and maybe also other uses if monads.
  2. --
  3. Rewrite MakeCatalog, so that it uses CatalogMaths functions. -- Otherwise the both modules do similar work, and keeping double code is -- a bad style.
  4. --
  5. Introduction of a new parameter value type: "reparsable" wrapping -- for parameter value.
  6. --
  7. CatalogMaths extension.
  8. --
  9. Enchance required SDLs with min & max functions.
  10. --
  11. Sacrificing ldtSubcompositesMap of LocalizedTemplate, which -- initially was introduced to enchance speed of messages generation, in -- favor of making catalogs easier to modify (which curently isn't -- supported and isn't an easy task).
  12. --
@package PCLT @version 0.1 -- | This module unifies some parts of bytestring (as is in -- 0.9.1.5 version) and utf8-string (as is in -- 0.3.6 version) packages - it exports -- Data.ByteString.Lazy.Char8, Data.ByteString.Lazy.UTF8 -- and System.IO.UTF8, while hiding from the first everything that -- is to be found in latter two. Ofcourse System.IO.UTF8 routines -- are wrapped to work with lazy ByteStrings instead of -- Strings. This way we get a module an -- Data.ByteString.Lazy.Char8 alternative that won't corrupt -- Unicode symbols, an that will make a proper IO with them. -- -- This module is intended to be imported qualified, to avoid name -- clashes with Prelude functions. eg. -- --
--   import qualified Data.ByteString.Lazy.UTF8.Unified as B
--   
-- -- or even -- --
--   import qualified Data.ByteString.Lazy.UTF8.Unified as Lazy     (ByteString)
--   import qualified Data.ByteString.Lazy.UTF8.Unified as B hiding (ByteString)
--   
module Data.ByteString.Lazy.UTF8.Unified -- | Simply saying: with SDL we regulate, how much some Reader (of our -- generated messages) wishes (is allowed) to see. -- -- "SDL" is an abbreviation for "Show Detalization Level". Perhaps it -- better sound "Representation Detalization Level", but it was too late -- to change term - too many variables has names sdl, and author -- is too lazy to change them on rdls. However, "Representation -- Detalization Level" version is sometimes used - it is to be understood -- as synonym to SDL. Term "Detailizable content (message)" in this -- package has a following meaning: some content, representing which it -- is possible to regulate, in how much of details it is to be -- represented. module Text.PCLT.SDL -- |
--   Zero_SDL < One_SDL < SDL Int < InfinitelyBig_SDL
--   
data ShowDetalizationLevel Zero_SDL :: ShowDetalizationLevel One_SDL :: ShowDetalizationLevel SDL :: Int -> ShowDetalizationLevel InfinitelyBig_SDL :: ShowDetalizationLevel -- | SDL may be seen in two different moduses: -- -- data SDLModus Allocated_SDLM :: SDLModus Required_SDLM :: SDLModus -- | In case, if SDL (of reciever of template requirement) is unclear, and -- if it is allowed by config - then SDL gets assigned according to -- margin: -- -- marginOfSDLModus :: SDLModus -> ShowDetalizationLevel strict_str2sdl :: String -> Maybe ShowDetalizationLevel instance Typeable SDLModus instance Typeable ShowDetalizationLevel instance Eq SDLModus instance Show SDLModus instance Ord ShowDetalizationLevel instance Eq ShowDetalizationLevel instance Show ShowDetalizationLevel module Text.PCLT.CommonTypes -- | It is highly recommended to use ISO 639-3 here - I mean it was -- originally intended to do so, and now a related package PCLT-DB works -- only with 3-letters (not bigger) languages names - there is a -- constraint in DB for that. type LanguageName = String type PCLT_ID = String -- | Localizable template ID. type PCLT_ParamKey = String -- | Here and in many places of package by "composite" is meant "template -- which is included in composed template". type PCLT_CompositeKey = PCLT_ID type PCLT_SuperCompositeKey = PCLT_CompositeKey type PCLT_SubCompositeKey = PCLT_CompositeKey type RequiredCompositeKey = PCLT_CompositeKey type RequirerCompositeKey = PCLT_CompositeKey type ParamName_LBS = ByteString module Text.PCLT.Config data StrictOrient_ofParamsAndCmpsts_onDfltLngTplsSets StrictOrient_ofParamsAndCmpsts_onDfltLngTplsSets :: Bool -> [PCLT_ID] -> [PCLT_ID] -> [PCLT_ParamKey] -> [(PCLT_ID, PCLT_ID)] -> [(PCLT_ID, PCLT_ParamKey)] -> StrictOrient_ofParamsAndCmpsts_onDfltLngTplsSets -- | Abbreviation = "SO". The exclusions has opposite roles for different -- values of this parameter. -- -- soStrict_IsIt :: StrictOrient_ofParamsAndCmpsts_onDfltLngTplsSets -> Bool -- | soExcludingInComposites :: StrictOrient_ofParamsAndCmpsts_onDfltLngTplsSets -> [PCLT_ID] -- | soExcludingComposites :: StrictOrient_ofParamsAndCmpsts_onDfltLngTplsSets -> [PCLT_ID] -- | soExcludingParameters :: StrictOrient_ofParamsAndCmpsts_onDfltLngTplsSets -> [PCLT_ParamKey] -- | soExcludingCompComposites :: StrictOrient_ofParamsAndCmpsts_onDfltLngTplsSets -> [(PCLT_ID, PCLT_ID)] -- | soExcludingCompParameters :: StrictOrient_ofParamsAndCmpsts_onDfltLngTplsSets -> [(PCLT_ID, PCLT_ParamKey)] type PCLT_InnerConfigID = Int -- | NOT USED, RESERVED FOR FUTURE VERSIONS OF PCLT! type ReparsingDepth = Int data PCLT_InnerConfig PCLT_InnerConfig :: PCLT_InnerConfigID -> ByteString -> ByteString -> ByteString -> ByteString -> LanguageName -> StrictOrient_ofParamsAndCmpsts_onDfltLngTplsSets -> Bool -> Bool -> Bool -> Int64 -> Bool -> Bool -> Bool -> ByteString -> ReparsingDepth -> Int64 -> PCLT_InnerConfig pcsInnerConfigID :: PCLT_InnerConfig -> PCLT_InnerConfigID -- | Symbols sequence denoting wrapping parentheses (identical for both - -- openning ang closing), that are to be put around *composite* name in a -- template text. pcsCompositePlaceholderWrapper :: PCLT_InnerConfig -> ByteString -- | Symbols sequence denoting wrapping parentheses (identical for both - -- openning ang closing), that are to be put around *parameter* name in a -- template text. pcsParameterPlaceholderWrapper :: PCLT_InnerConfig -> ByteString -- | For case, when representation reciever uses detalization level, that -- isn't enough to meet requirement specified by the template (from which -- representation was to be made): symbols sequence, that PCLT engine -- must place instead of content from template/composite. pcsInsuficientDetLevelPlaceholder :: PCLT_InnerConfig -> ByteString -- | Symbols sequence denoting wrapping parentheses (identical for both - -- openning ang closing), that are to be put (by PCLT engine) in -- representation, where it failed to make a proper representation from a -- template piece (composite or parameter). pcsMarkingErrorPlaceholderWrapper :: PCLT_InnerConfig -> ByteString -- | Catalog default (primary) language. pcsDefaultLanguage :: PCLT_InnerConfig -> LanguageName -- | Object: -- --
    --
  1. Should all localizations of template be strictly oriented on -- localization in default (primary) language? (in case of such -- orientation, NO template localized in a nondefault language is allowed -- to have sets of composites and parameters different from ones -- specified for template localization in the default language)
  2. --
  3. Exclusions - when not to be strict with templates structures, - if -- strictness is on; or when to be strict, - if strictness is off.
  4. --
pcsStrictOrient_ofParamsAndCmpsts_onDfltLngTplsSets :: PCLT_InnerConfig -> StrictOrient_ofParamsAndCmpsts_onDfltLngTplsSets -- | Is it allowed to demand representations from catalog, when referenced -- template/composite ID isn't known in given catalog? In case, if -- allowed, on place of unknown composite the engine (when making -- representation) will simply put it's (unknown) ID (given that -- recievers detailization level statisfies a requirement: it must be -- maximal (infinitely big)), followed by (if enabled by other config -- parameter) all the parameters used by current instaniation. pcsAllowUntemplatedMessages :: PCLT_InnerConfig -> Bool -- | Is it allowed to demand representations from catalog, when referenced -- template/composite ID is persistent in catalog, but not in -- representation language? In case, if allowed, on place of unknown -- composite the engine (when making representation) will simply put it's -- (unknown) ID (given that recievers detailization level statisfies a -- requirement: it must be maximal (infinitely big)), followed by (if -- enabled by other config parameter) all the parameters used by current -- instaniation. pcsAllowUntemplatedLocalizationsOfMessages :: PCLT_InnerConfig -> Bool -- | If it's allowed to require representation of a template/composite (or -- it's localisation), that is absent in catalog then (given that -- reciever's detailization level statisfies a requirement: it must be -- maximal (infinitely big)) together with it's (unknown composite) ID: -- should there also be put all the parameters (array of name:value -- pairs), used by current instaniation? pcsShowAdhocParamsInResultOfUntemplated :: PCLT_InnerConfig -> Bool -- | DEFAULT maximal allowed size of representation resulting from -- instaniation of a single PCSI. If user gives on the input his -- ConstraintedLBS with different constraint on size, then his constraint -- is used instead. pcsInstaniationResultMaxSize :: PCLT_InnerConfig -> Int64 -- | Is it allowed to give an empty value to the field "representation -- detailization level" (Text.PCLT.SDL)? If allowed, then it's -- value will be chosen automatically by the margin depending on modus: -- maximal ("+inf") in case, when it's a requirement by a template, or -- minimal ("zero"), when it's an assigment to a reciever of -- representation pcsAllowEmptySDL_parseItByModusMargin :: PCLT_InnerConfig -> Bool -- | Is it allowed to give an unreadable value to the field "representation -- detailization level" (Text.PCLT.SDL)? If allowed, then it's -- value will be chosen automatically by the margin depending on modus: -- maximal ("+inf") in case, when it's a requirement by a template, or -- minimal ("zero"), when it's an assigment to a reciever of -- representation pcsAllowUnreadableSDL_parseIdByModusMargin :: PCLT_InnerConfig -> Bool -- | If pcsi2text (Text.PCLT.MakeMessage) function fails to -- determine an SDL requiered by used template (due to referential cycle, -- missing referenced template, PCLT_SDL_Errornous or other -- reason) - should this failure lead to absolute denial to represent -- problem template, or should the pcsi2text treat it like -- "+inf" (PCLT_SDL InfinitelyBig_SDL)? The error will be -- returned anyway, but question is purely about output representation. pcsAllowFailureToDetermineSDL_parseIdByModusMargin :: PCLT_InnerConfig -> Bool -- | Sequence of symbols used, when representing a specialcase of parameter -- value - Newline_PV (Text.PCLT.PCSI). (Different OSes -- use different newline strings: in Linux it's #10, in M$ - #13#10, -- MacOS - #13) pcsNewlineLBS :: PCLT_InnerConfig -> ByteString -- | NOT USED, RESERVED FOR FUTURE VERSIONS OF PCLT! Maximal allowed depth -- of reparsing. pcsReparsingDepthMax :: PCLT_InnerConfig -> ReparsingDepth -- | NOT USED, RESERVED FOR FUTURE VERSIONS OF PCLT! Maximal allowed size -- of representation resuling from instaniating a reparsing result. pcsReparseParameterContentMaxSize :: PCLT_InnerConfig -> Int64 -- |
--   PCLT_InnerConfig {
--             pcsInnerConfigID = 0
--           , pcsCompositePlaceholderWrapper = B.pack "##|"
--           , pcsParameterPlaceholderWrapper = B.pack "@@|"
--           , pcsInsuficientDetLevelPlaceholder = B.pack "#x#"
--           , pcsMarkingErrorPlaceholderWrapper = B.pack "/!E!\"
--           , pcsDefaultLanguage                = "eng"
--           , pcsStrictOrient_ofParamsAndCmpsts_onDfltLngTplsSets =
--                     StrictOrient_ofParamsAndCmpsts_onDfltLngTplsSets {
--                               soStrict_IsIt = True
--                             , soExcludingInComposites   = []
--                             , soExcludingComposites     = []
--                             , soExcludingParameters     = []
--                             , soExcludingCompComposites = []
--                             , soExcludingCompParameters = []
--                     }
--           , pcsAllowUntemplatedMessages                = True
--           , pcsAllowUntemplatedLocalizationsOfMessages = True
--           , pcsShowAdhocParamsInResultOfUntemplated    = True
--           , pcsInstaniationResultMaxSize               = 10000000
--           , pcsAllowEmptySDL_parseItByModusMargin      = False
--           , pcsAllowUnreadableSDL_parseIdByModusMargin = False
--           , pcsAllowFailureToDetermineSDL_parseIdByModusMargin = False
--           , pcsNewlineLBS                              = B.pack "\n"
--     }
--   
defaultPCLTInnerConfig :: PCLT_InnerConfig instance Typeable PCLT_InnerConfig instance Typeable StrictOrient_ofParamsAndCmpsts_onDfltLngTplsSets instance Show PCLT_InnerConfig instance Read StrictOrient_ofParamsAndCmpsts_onDfltLngTplsSets instance Show StrictOrient_ofParamsAndCmpsts_onDfltLngTplsSets module Text.PCLT.Parser.AdvancedSepBy type SeparationMarkerIdx = Int data SeparatedSectorMarker Beginning_SSM :: SeparatedSectorMarker EOF_SSM :: SeparatedSectorMarker InnerMarker_SSM :: SeparationMarkerIdx -> SeparatedSectorMarker Error_SSM :: StandartMarkingStrategyError -> SeparatedSectorMarker type MarkedChunkLength = Int64 manyTill_EOForEitherOf :: Parser Char -> [Parser ByteString] -> Parser (SeparatedSectorMarker, ByteString, MarkedChunkLength) type New_Active_Sep_SSM = SeparatedSectorMarker type Previous_Active_Sep_SSM = SeparatedSectorMarker type Current_Sep_SSM = SeparatedSectorMarker type Current_Chunk_SSM = SeparatedSectorMarker type SectorMarkingStrategy = (Previous_Active_Sep_SSM, Current_Sep_SSM) -> (Current_Chunk_SSM, New_Active_Sep_SSM) sepBySome :: Parser Char -> SectorMarkingStrategy -> [Parser ByteString] -> Parser [(SeparatedSectorMarker, ByteString, MarkedChunkLength)] data StandartMarkingStrategyError InputAfterEOF_SMSE :: StandartMarkingStrategyError BeginningMNotInTheBeginning_SMSE :: StandartMarkingStrategyError OverlappingMarkedChunks_SMSE :: StandartMarkingStrategyError UnsupportedMarkersSequence_SMSE :: SeparatedSectorMarker -> SeparatedSectorMarker -> StandartMarkingStrategyError OpenMarkerAtEOF_SMSE :: SeparationMarkerIdx -> StandartMarkingStrategyError UnallowedCharacter_SMSE :: Char -> StandartMarkingStrategyError standardMarkingStrategy :: SectorMarkingStrategy standardMarkingStrategyFix_StripEmptyChunks :: [(SeparatedSectorMarker, ByteString, MarkedChunkLength)] -> [(SeparatedSectorMarker, ByteString, MarkedChunkLength)] type ChunkIndexInList_ = Int retrieveNonPlainMarkingsMap :: [(SeparatedSectorMarker, ByteString, MarkedChunkLength)] -> Map SeparatedSectorMarker [(ByteString, ChunkIndexInList_)] getListOfMarkings :: Map SeparatedSectorMarker [(ByteString, ChunkIndexInList_)] -> Int -> [(ByteString, ChunkIndexInList_)] retrieveErrorsMarkingsList :: [(SeparatedSectorMarker, ByteString, MarkedChunkLength)] -> [(SeparatedSectorMarker, ByteString, ChunkIndexInList_)] insertInsteadOf_inLBS :: (ByteString, ByteString) -> ByteString -> ByteString instance Eq StandartMarkingStrategyError instance Ord StandartMarkingStrategyError instance Eq SeparatedSectorMarker instance Ord SeparatedSectorMarker instance Show StandartMarkingStrategyError instance Show SeparatedSectorMarker -- | The analogue to ordinary lazy ByteString, but with a -- constraint on size, and some routines, thet respects the constraint. module Text.ConstraintedLBS -- | The analogue to ordinary lazy ByteString, but with a -- constraint on size. data CLBS CLBS :: ByteString -> Int64 -> Int64 -> Bool -> CLBS clbsLBS :: CLBS -> ByteString clbsLen :: CLBS -> Int64 clbsMaxLen :: CLBS -> Int64 -- | Bytestring is finalized, when something is appended to it, that makes -- clbsMaxLen to be reached. The last 3 bytes of a finalized -- bytestring are always made "..." (by routines of this module, that -- manage finalization). clbsFinalized_isit :: CLBS -> Bool clbsFreeSpaceLeft :: CLBS -> Int64 -- | Make a CLBS with a specified maximum on length. newCLBS :: Int64 -> CLBS -- | Append first lazy ByteString (given in tuple with it's -- (trusted) length) to a CLBS. If the result of appending -- violates clbsMaxLen constraint, then the content gets truncated, -- tailed with "..." and CLBS is finalized (nothing more can be added to -- it) addToCLBS_1 :: (ByteString, Int64) -> CLBS -> CLBS -- | Produce an empty CLBS, that would have the maximum of length -- equal to free space left available in specified CLBS. freeSpaceCLBS :: CLBS -> CLBS -- | Append first to second. If the result of appending violates clbsMaxLen -- constraint, then the content gets truncated, tailed with "..." and -- CLBS is finalized (nothing more can be added to it) addToCLBS_2 :: CLBS -> CLBS -> CLBS -- | Make CLBS contain specified ByteString, keeping the -- length constraint. If the specified bytestring violates clbsMaxLen -- constraint, then the content gets truncated, tailed with "..." and -- CLBS is finalized (nothing more can be added to it) adjustCLBS_to :: CLBS -> ByteString -> CLBS -- | Given insertInsteadOf_inCLBS (old_separator, new_separator) -- clbs, function replaces every occurence of old_separator -- on new_separator respecting length constraint (and possibly -- finalizing CLBS). insertInsteadOf_inCLBS :: (ByteString, ByteString) -> CLBS -> CLBS -- | Empify, and if finalized, make not. resetCLBS :: CLBS -> CLBS type StdOut_CLBS = CLBS type StdErr_CLBS = CLBS type StdOutAndErr_CLBS = CLBS -- | Append to first lazy bytestring the second one. The available space -- for append is constrainted by the 3rd argument. Every bytestring must -- be specified in tuple together with it's length (this is done to speed -- up by reducing repeating length calls), which is trusted. If -- length of added string is bigger then available for append, the result -- will be truncated and will have a "..." tail. -- -- Function returns resulting ByteString, it's length and boolean -- indicating if length of added string was bigger than available for -- append space. concatTruncedLiteraryLBS :: (ByteString, Int64) -> (ByteString, Int64) -> Int64 -> (ByteString, Int64, Bool) instance Show CLBS -- | Here are declared LocalizableTemplate (also called PCLT) and -- LocalizedTemplate. Here by localization is meant localization -- in languages. First (localizable template) is above languages, while -- second (localized template) is a template version in a concrete -- language. module Text.PCLT.Template -- | These are types of template pieces. They are made by ssm2ldtm -- from SeparatedSectorMarker data PCS_SpecificMarkings PlainText_LngTplM :: PCS_SpecificMarkings Parameter_LngTplM :: PCS_SpecificMarkings Composite_LngTplM :: PCS_SpecificMarkings Unsupported_LngTplM :: SeparatedSectorMarker -> PCS_SpecificMarkings ssm2ldtm :: SeparatedSectorMarker -> PCS_SpecificMarkings -- | Template content. type LngTpl_AbstractedString = [(PCS_SpecificMarkings, ByteString, MarkedChunkLength)] -- | Extract a list of parameter names from a template content. listOfParams :: LngTpl_AbstractedString -> [ParamName_LBS] type ParserBadResult = String -- | These errors are possible only if program is wrong. data PCLT_ParserLowLevelFailure UnexpectedParserResult_PLLF_PCLT :: ParserBadResult -> PCLT_ParserLowLevelFailure BadMarker_PLLF_PCLT :: SeparatedSectorMarker -> ByteString -> ChunkIndexInList_ -> PCLT_ParserLowLevelFailure -- | The parsing uses parameters -- Test.PCLT.Config.pcsParameterPlaceholderWrapper and -- Test.PCLT.Config.pcsCompositePlaceholderWrapper of -- Test.PCLT.Config.PCLT_InnerConfig. The list -- [PCLT_CompositeKey] in the result is a list of composite keys -- (template IDs, used by template as inclusions) doTheParse :: PCLT_InnerConfig -> ByteString -> ([PCLT_ParserLowLevelFailure], Maybe (LngTpl_AbstractedString, [PCLT_CompositeKey])) type PCLT_CatalogMap = Map PCLT_ID LocalizableTemplate type LngTpl_SubCompositesMap = PCLT_CatalogMap data LocalizedTemplate LocalizedTemplate :: LngTpl_AbstractedString -> LngTpl_SubCompositesMap -> LocalizedTemplate ldtAbstractedString :: LocalizedTemplate -> LngTpl_AbstractedString -- | Each composition tree is kept together with each localization. This is -- done for speedup and is a source of complexities, when forming a -- catalog and sustaining it's data consistency. So it comes to this: -- templates are purely-referenced by -- -- -- -- By "purely-reference" here is meant, that templates are formed only -- once, they have one instace in memory, but are referenced twice - from -- composeds and from catalog map ldtSubcompositesMap :: LocalizedTemplate -> LngTpl_SubCompositesMap type DefaultLngTpl = LocalizedTemplate type NondefaultLngTpl = LocalizedTemplate -- | Carrying strict orientation routines. See description of -- StrictOrient_ofParamsAndCmpsts_onDfltLngTplsSets. compareStrictOrientationOnDefault :: PCLT_ID -> StrictOrient_ofParamsAndCmpsts_onDfltLngTplsSets -> NondefaultLngTpl -> DefaultLngTpl -> Bool _compareStrictOrientationOnDefault :: PCLT_ID -> StrictOrient_ofParamsAndCmpsts_onDfltLngTplsSets -> ([PCLT_ID], [ParamName_LBS]) -> ([PCLT_ID], [ParamName_LBS]) -> Bool -- | This is an extending wrapper around SDL. It is used for specification -- of requirement for making representation from template. This -- specification is attached to every localizable template in PCLT -- catalog data PCLT_ShowDetalizationLevel -- | Plain SDL, nominal. If SDL of representation reciever is less then -- that, then template cann't be used in representation generation. PCLT_SDL :: ShowDetalizationLevel -> PCLT_ShowDetalizationLevel -- | "The requirement is the same as is specified for referenced template". PCLT_SDL_ToTemplateLink :: PCLT_ID -> PCLT_ShowDetalizationLevel -- | "The requirement is the same as is specified a for referenced -- template, which is referenced by a PCSI_PV value of -- referenced parameter (of current template)". PCLT_SDL_ToParamCompositeLink :: PCLT_ParamKey -> PCLT_ShowDetalizationLevel -- | In input data for catalog formation the given specification is -- errornous. If config's (Text.PCLT.Config) parameters -- pcsAllowEmptySDL_parseItByModusMargin and/or -- pcsAllowUnreadableSDL_parseIdByModusMargin are positive, then -- instead of PCLT_SDL_Errornous the parser -- (str2PCLT_SDL) will use marginOfSDLModus to set valid -- specification. When representation generator meets -- PCLT_SDL_Errornous it won't use template, and return an -- error. PCLT_SDL_Errornous :: PCLT_ErrornousSDL -> PCLT_ShowDetalizationLevel type PCLT_RequiredShowDetalizationLevel = PCLT_ShowDetalizationLevel type PCLT_AllocatedShowDetalizationLevel = PCLT_ShowDetalizationLevel -- | Raw templates (both localizeds, and localizables). Input data for -- catalog formation. Used by HasStaticRawPCLTs class (declared -- in Text.PCLT.HasStaticRawPCLTs) data PCLT_RawCatalogData PCLT_RawCatalogData :: (Map PCLT_ID (Map LanguageName ByteString, PCLT_RequiredShowDetalizationLevel)) -> PCLT_RawCatalogData -- | This is a bad result of parsing some String into -- PCLT_ShowDetalizationLevel. The second argument is this bad -- input. data PCLT_ErrornousSDL UnreadableSDL_ESDL :: SDLModus -> String -> PCLT_ErrornousSDL -- | A constant currently set to 25. It is used in a parser -- str2PCLT_SDL: if the input is errornous, this much symbols of -- input are saved in UnreadableSDL_ESDL. If input is bigger, then -- the saved trunc is tailed with "..." __const_esdl_rawinputshowsize_inShowAsPCSI :: Int -- | Parse String into PCLT_ShowDetalizationLevel. First of -- all parser tries strict_str2sdl. Then, if failed, parser uses -- following config entries: -- -- str2PCLT_SDL :: SDLModus -> String -> PCLT_InnerConfig -> PCLT_ShowDetalizationLevel data LocalizableTemplate LocalizableTemplate :: Map LanguageName LocalizedTemplate -> PCLT_RequiredShowDetalizationLevel -> LocalizableTemplate pcltLocalizationsMap :: LocalizableTemplate -> Map LanguageName LocalizedTemplate -- | If SDL of representation reciever is less then that, then template -- cann't be used in representation generation. pcltRequiredSDL :: LocalizableTemplate -> PCLT_RequiredShowDetalizationLevel instance Typeable LocalizableTemplate instance Typeable PCLT_ErrornousSDL instance Typeable PCLT_RawCatalogData instance Typeable PCLT_ShowDetalizationLevel instance Typeable LocalizedTemplate instance Typeable PCLT_ParserLowLevelFailure instance Typeable PCS_SpecificMarkings instance Show LocalizableTemplate instance Eq PCLT_ErrornousSDL instance Show PCLT_ErrornousSDL instance Show PCLT_RawCatalogData instance Eq PCLT_ShowDetalizationLevel instance Show PCLT_ShowDetalizationLevel instance Show LocalizedTemplate instance Show PCLT_ParserLowLevelFailure instance Eq PCS_SpecificMarkings instance Show PCS_SpecificMarkings module Text.PCLT.Catalog type PCLT_CatalogID = Int data PCLT_Catalog PCLT_Catalog :: PCLT_CatalogID -> PCLT_CatalogMap -> PCLT_InnerConfig -> PCLT_Catalog pcltcCatalogID :: PCLT_Catalog -> PCLT_CatalogID pcltcCatalogMap :: PCLT_Catalog -> PCLT_CatalogMap -- | It is highly recommended not to change this param values after catalog -- is formed, since it's easy to spoil catalog content that way. pcltcInnerConfig :: PCLT_Catalog -> PCLT_InnerConfig catInstMaxLen :: PCLT_Catalog -> Int64 catDfltLng :: PCLT_Catalog -> LanguageName catStrictOrient :: PCLT_Catalog -> StrictOrient_ofParamsAndCmpsts_onDfltLngTplsSets catSize :: PCLT_Catalog -> Int data TplDefaultLngIsMissing_PCLTE TplDefaultLngIsMissing_PCLTE :: PCLT_CompositeKey -> TplDefaultLngIsMissing_PCLTE data DefaultLngTplComponentsParamsSetsDiffersFromOnesOfNondefault_PCLTE DefaultLngTplComponentsParamsSetsDiffersFromOnesOfNondefault_PCLTE :: PCLT_CompositeKey -> LanguageName -> DefaultLngTplComponentsParamsSetsDiffersFromOnesOfNondefault_PCLTE data RequiredCompositeIsMissing_PCLTE RequiredCompositeIsMissing_PCLTE :: RequiredCompositeKey -> RequiredCompositeIsMissing_PCLTE data RequiredByRequirerCompositeIsMissing_PCLTE RequiredByRequirerCompositeIsMissing_PCLTE :: RequirerCompositeKey -> RequiredCompositeIsMissing_PCLTE -> RequiredByRequirerCompositeIsMissing_PCLTE data CompositionCycle_PCLTE CompositionCycle_PCLTE :: PCLT_CompositeKey -> [PCLT_CompositeKey] -> CompositionCycle_PCLTE data TplUniquenessViol_PCLTE TplUniquenessViol_PCLTE :: PCLT_ID -> [LanguageName] -> TplUniquenessViol_PCLTE type MainUnit_SDL = PCLT_ShowDetalizationLevel type AddedUnit_SDL = PCLT_ShowDetalizationLevel data DifferentSDLs_PCLTE DifferentSDLs_PCLTE :: PCLT_ID -> (MainUnit_SDL, AddedUnit_SDL) -> DifferentSDLs_PCLTE data ErrorWithPCSCatalog a ErrorWithPCSCatalog :: PCLT_CatalogID -> a -> ErrorWithPCSCatalog a instance Typeable1 ErrorWithPCSCatalog instance Typeable DifferentSDLs_PCLTE instance Typeable TplUniquenessViol_PCLTE instance Typeable CompositionCycle_PCLTE instance Typeable RequiredByRequirerCompositeIsMissing_PCLTE instance Typeable RequiredCompositeIsMissing_PCLTE instance Typeable DefaultLngTplComponentsParamsSetsDiffersFromOnesOfNondefault_PCLTE instance Typeable TplDefaultLngIsMissing_PCLTE instance Typeable PCLT_Catalog instance Show a => Show (ErrorWithPCSCatalog a) instance Show DifferentSDLs_PCLTE instance Show TplUniquenessViol_PCLTE instance Show CompositionCycle_PCLTE instance Show RequiredByRequirerCompositeIsMissing_PCLTE instance Show RequiredCompositeIsMissing_PCLTE instance Show DefaultLngTplComponentsParamsSetsDiffersFromOnesOfNondefault_PCLTE instance Show TplDefaultLngIsMissing_PCLTE instance Show PCLT_Catalog -- | A module around comlex function _readPCLTCatalog. module Text.PCLT.MakeCatalog type Parsed_DidWe = Bool -- | Error type for _readPCLTCatalog. -- -- Descriptios for some value constructors: -- -- data ReadPCSCatalogError CompositionCycle_RPCSCE :: CompositionCycle_PCLTE -> ReadPCSCatalogError RequiredCompositeIsMissing_RPCSCE :: RequiredByRequirerCompositeIsMissing_PCLTE -> ReadPCSCatalogError RequiredCompositeIsUnparsable_RPCSCE :: RequirerCompositeKey -> RequiredCompositeKey -> ReadPCSCatalogError ParseFailedForDefaultLng_RPCSCE :: PCLT_CompositeKey -> Parsed_DidWe -> [PCLT_ParserLowLevelFailure] -> ReadPCSCatalogError TplDefaultLngIsMissing_RPCSCE :: TplDefaultLngIsMissing_PCLTE -> ReadPCSCatalogError ParseFailedForNondefaultLng_RPCSCE :: PCLT_CompositeKey -> Parsed_DidWe -> LanguageName -> [PCLT_ParserLowLevelFailure] -> ReadPCSCatalogError DefaultLngTplComponentsParamsSetsDiffersFromOnesOfNondefault_RPCSCE :: DefaultLngTplComponentsParamsSetsDiffersFromOnesOfNondefault_PCLTE -> ReadPCSCatalogError DifferentSDLs_RPCSCE :: DifferentSDLs_PCLTE -> ReadPCSCatalogError TplUniquenessViol_RPCSCE :: TplUniquenessViol_PCLTE -> ReadPCSCatalogError SDL_ToCompositeLinkRefsToNonexistent_RPCSCE :: RequirerCompositeKey -> RequiredCompositeKey -> ReadPCSCatalogError DRL_NormalizationError_RPCSCE :: DRL_NormalizationError -> ReadPCSCatalogError -- | Wrapper around _readPCLTCatalog. To be used when starting with -- an empty catalog. readPCLTCatalog :: PCLT_InnerConfig -> PCLT_CatalogID -> PCLT_RawCatalogData -> (PCLT_Catalog, [ErrorWithPCSCatalog ReadPCSCatalogError]) -- | Take a bunch of raw templates, parse them into normal templates and -- add them to a catalog. _readPCLTCatalog :: (PCLT_Catalog, [ReadPCSCatalogError]) -> PCLT_RawCatalogData -> (PCLT_Catalog, [ErrorWithPCSCatalog ReadPCSCatalogError]) -- | Error type for normalizeReferentialSDLs. data DRL_NormalizationError SDL_ToCompositeLinksCycle_DRLNE :: [PCLT_CompositeKey] -> DRL_NormalizationError SDL_DetFail_ToCompositeLinkRefsToNonexistent_DRLNE :: RequirerCompositeKey -> RequiredCompositeKey -> DRL_NormalizationError -- | Under "Referential SDLs normalization" here is understood the -- following. Now consider paths like: -- --
--   Tpl_1.pcltRequiredSDL -> Tpl_2.pcltRequiredSDL
--   
-- -- which means pcltRequiredSDL of Tpl_1 is specified -- (using PCLT_SDL_ToTemplateLink) to be the same as for -- Tpl_2. Here we can reduce the PCLT_SDL_ToTemplateLink -- of Tpl_1 by assinging instead of it -- Tpl_2.pcltRequiredSDL value. Data consistency is -- respected. We win in speed of Tpl_1.pcltRequiredSDL -- determination. The negative side of this, is that we can't change -- Tpl_2.pcltRequiredSDL anymore without spoiling data -- consistency. That's another reason why a PCLT catalog is so hard to -- modify. Perhaps the problem will be solved in future versions of PCLT. -- -- So this function reduces all PCLT_SDL_ToTemplateLinks in a -- given PCLT_CatalogMap, BUT, only where they lead to -- PCLT_SDLs or to other PCLT_SDL_ToTemplateLinks (which -- recursively gets considered to be reduced), not when it leads to -- PCLT_SDL_ToParamCompositeLink or PCLT_SDL_Errornous. normalizeReferentialSDLs :: PCLT_CatalogMap -> (PCLT_CatalogMap, [DRL_NormalizationError]) -- | Error type for adhoc_str2ldt. data AHSTR2LngTpl_Error ParseFailure_AHS2PE :: [PCLT_ParserLowLevelFailure] -> AHSTR2LngTpl_Error RequiredCompositeIsMissing_AHS2PE :: RequiredCompositeIsMissing_PCLTE -> AHSTR2LngTpl_Error -- | Make a LocalizedTemplate out of a single ByteString. adhoc_str2ldt :: (ByteString, LanguageName) -> PCLT_Catalog -> Either AHSTR2LngTpl_Error LocalizedTemplate -- | Make a LocalizableTemplate out of a single ByteString. str2pclt :: (PCLT_ID, PCLT_AllocatedShowDetalizationLevel) -> (LanguageName, ByteString) -> PCLT_Catalog -> Either (ErrorWithPCSCatalog ReadPCSCatalogError) LocalizableTemplate -- | Make a LocalizableTemplate out of list of ByteStrings. str_list2pclt :: (PCLT_ID, PCLT_AllocatedShowDetalizationLevel) -> Map LanguageName ByteString -> PCLT_Catalog -> (LocalizableTemplate, [ErrorWithPCSCatalog ReadPCSCatalogError]) instance Typeable AHSTR2LngTpl_Error instance Typeable DRL_NormalizationError instance Typeable ReadPCSCatalogError instance Show AHSTR2LngTpl_Error instance Show DRL_NormalizationError instance Show ReadPCSCatalogError -- | Functions from this module isn't used for catalog formation. It's not -- very wise to have two similar codes of catalog maths here and in -- module Text.PCLT.MakeCatalog, since it raises double -- maintenence problem. Perhaps the problem will be solved in future -- versions. -- -- The math's errors, however, seems to be of use in other modules. module Text.PCLT.CatalogMaths -- | Error type for addLngTpl_toPCLT. data AddLngTpl_toPCLT_Error TplUniquenessViol_APSTPTE :: TplUniquenessViol_PCLTE -> AddLngTpl_toPCLT_Error DefaultLngTplComponentsParamsSetsDiffersFromOnesOfNondefault_APSTPTE :: DefaultLngTplComponentsParamsSetsDiffersFromOnesOfNondefault_PCLTE -> AddLngTpl_toPCLT_Error -- | Adds localized template as a special case of localizable template. addLngTpl_toPCLT :: PCLT_ID -> (LanguageName, LocalizedTemplate) -> LocalizableTemplate -> PCLT_InnerConfig -> (LocalizableTemplate, [AddLngTpl_toPCLT_Error]) -- | Error type for addPCLT_toPCLT. data AddPCLT_toPCLT_Error AddLngTpl_toPCLT_Error_APTTPTE :: AddLngTpl_toPCLT_Error -> AddPCLT_toPCLT_Error DifferentSDLs_APTTPTE :: DifferentSDLs_PCLTE -> AddPCLT_toPCLT_Error -- | Adds up localizable templates, their localized cases. addPCLT_toPCLT :: PCLT_ID -> LocalizableTemplate -> LocalizableTemplate -> PCLT_InnerConfig -> (LocalizableTemplate, [AddPCLT_toPCLT_Error]) instance Typeable AddPCLT_toPCLT_Error instance Typeable AddLngTpl_toPCLT_Error instance Show AddPCLT_toPCLT_Error instance Show AddLngTpl_toPCLT_Error -- | A way to store templates is by assigning them to types. module Text.PCLT.HasStaticRawPCLTs data RawPCLTsSetWideness AlgebraicDataType_RPSW :: RawPCLTsSetWideness Module_RPSW :: RawPCLTsSetWideness Package_RPSW :: RawPCLTsSetWideness System_RPSW :: RawPCLTsSetWideness class HasStaticRawPCLTs t getStaticRawPCLTs :: HasStaticRawPCLTs t => PCLT_InnerConfig -> t -> (PCLT_RawCatalogData, [AddPCLT_toPCLT_Error]) widenessOfStaticRawPCLTsSet :: HasStaticRawPCLTs t => t -> RawPCLTsSetWideness mergeRawCatalogDataSets :: Bool -> [PCLT_RawCatalogData] -> (PCLT_RawCatalogData, [AddPCLT_toPCLT_Error]) mergeRawCatalogDataSets2 :: Bool -> [(PCLT_RawCatalogData, [AddPCLT_toPCLT_Error])] -> (PCLT_RawCatalogData, [AddPCLT_toPCLT_Error]) instance Typeable RawPCLTsSetWideness instance Show RawPCLTsSetWideness -- | The abbreviation "PCSI" means "Parametric Composable String -- Instaniation". Agree, not a very clear name, a more apropriate would -- be something like that: "Input Data for Template Representation", but -- clear name came to my head when millions (dozens) of ants (variables) -- were already bearing this name. And I'm a bit lazy to rename -- everything to sound apropriate, sorry. module Text.PCLT.PCSI -- | By these user fills parameters of templates. data PCLT_ParamVal PlainText_PV :: String -> PCLT_ParamVal PlainTextLBS_PV :: ByteString -> PCLT_ParamVal PCSI_PV :: PCSI -> PCLT_ParamVal -- | Second argument is a separator between PCSIs in first argument -- Here representation generator automatically adds to each PCSI in list -- an implicit parameter __row_idx, which holds a value of -- current PCSI index in list, starting from 1. PCSIList_PV :: [PCSI] -> PCLT_ParamVal -> PCLT_ParamVal PVList_PV :: [PCLT_ParamVal] -> PCLT_ParamVal -- | In message generation procedure this stands for a value of 2nd -- argument in which every occurence of newline (as is configured in -- Text.PCLT.Config in config's parameter pcsNewlineLBS) -- is substituded by newline ++ (replicate n ' '), where n is -- the 1st argument Indented_PV :: Int -> PCLT_ParamVal -> PCLT_ParamVal -- | In message generation procedure this stands for a value of -- pcsNewlineLBS parameter declared in Text.PCLT.Config. -- Different systems means different symbol sequences under "newline"... NewLine_PV :: PCLT_ParamVal Nothing_PV :: PCLT_ParamVal type PCSI_ParamsValuesMap = Map PCLT_ParamKey PCLT_ParamVal -- | PCSI is an output of our extended Show (to which this package is -- dedicated). And an input to generate a message using catalog. data PCSI PCSI :: PCLT_ID -> PCSI_ParamsValuesMap -> PCSI pcsiTplID :: PCSI -> PCLT_ID pcsiParamsValsMap :: PCSI -> PCSI_ParamsValuesMap -- | PCSI with an empty set of parameters values. empPCSI :: PCLT_ID -> PCSI thePCSI :: PCLT_ID -> [(PCLT_ParamKey, PCLT_ParamVal)] -> PCSI addToPCSI :: [PCSI] -> PCSI -> PCSI sumPCSI_PVMs :: PCSI_ParamsValuesMap -> PCSI_ParamsValuesMap -> PCSI_ParamsValuesMap addPVs2PCSI :: [(PCLT_ParamKey, PCLT_ParamVal)] -> PCSI -> PCSI -- | It's used in some places of package in errors' representations (in -- instances of ShowAsPCSI - class declared in -- Text.PCLT.ShowAsPCSI). usualSeparatorInPCSIList = PVList_PV -- [NewLine_PV, PlainText_PV |----, NewLine_PV] usualSeparatorInPCSIList :: PCLT_ParamVal instance Typeable PCSI instance Typeable PCLT_ParamVal instance Show PCSI instance Show PCLT_ParamVal -- | Module around pcsi2text function, which generates a message out -- of PCSI and PCLT_Catalog. module Text.PCLT.MakeMessage -- | Error type for pcsi2text. data PCSI2Text_Error RequiredCompositeIsMissing_P2TE :: RequiredByRequirerCompositeIsMissing_PCLTE -> PCSI2Text_Error RequiredCompositeLoclizationIsMissing_P2TE :: RequiredByRequirerCompositeIsMissing_PCLTE -> LanguageName -> PCSI2Text_Error CompositionCycle_P2TE :: CompositionCycle_PCLTE -> PCSI2Text_Error SDL_DeterminationFailure_P2TE :: PCLT_ID -> SDL_DeterminationFailure -> PCSI2Text_Error -- | This error is possible only if program is wrong. UnsupportedMarker_P2TE :: SeparatedSectorMarker -> ByteString -> PCLT_ID -> LanguageName -> PCSI2Text_Error NoValueForParameter_P2TE :: PCLT_ID -> LanguageName -> PCLT_ParamKey -> PCSI2Text_Error -- | Not used, reserved for future versions. UnderAccordingParamReparsingFailure_P2TE :: PCLT_ID -> LanguageName -> PCLT_ParamKey -> ReadPCSCatalogError -> PCSI2Text_Error -- | Not used, reserved for future versions. ReparsingDepthMaxReached_P2TE :: PCLT_ID -> LanguageName -> PCLT_ParamKey -> ReparsingDepth -> PCSI2Text_Error -- | Not used, reserved for future versions. ReparsingLengthMaxReached_P2TE :: PCLT_ID -> LanguageName -> PCLT_ParamKey -> ForInstaniationUsedChunkLength -> PCSI2Text_Error -- | No more free space in resulting CLBS. InstaniationLengthMaxReached_P2TE :: PCLT_ID -> LanguageName -> ForInstaniationUsedChunkLength -> PCSI2Text_Error -- | Error type for givenSDL_statisfies. data SDL_DeterminationFailure RequiredCompositeIsMissing_SDLDF :: RequiredByRequirerCompositeIsMissing_PCLTE -> SDL_DeterminationFailure -- | The SDL of template is specified (using -- PCLT_SDL_ToParamCompositeLink) to be the same as is one of a -- template, that must have been put under a parameter (using -- PCSI_PV), but referenced parameter is missing in given -- PCSI MissingParam_SDLByParamCompositeLink_SDLDF :: PCLT_CompositeKey -> PCLT_ParamKey -> SDL_DeterminationFailure -- | The SDL of template is specified (using -- PCLT_SDL_ToParamCompositeLink) to be the same as is one of a -- template, that must have been put under a parameter (using -- PCSI_PV), but referenced parameter value is constructed using -- not PCSI_PV. WrongParamType_SDLByParamCompositeLink_SDLDF :: PCLT_CompositeKey -> PCLT_ParamKey -> SDL_DeterminationFailure -- | The SDL of template is specified (using -- PCLT_SDL_ToParamCompositeLink) to be the same as is one of a -- template, that must have been put under a parameter (using -- PCSI_PV), but the PCSI under this parameter references -- some unknown (to catalog) template. UnknownComposite_SDLByParamCompositeLink_SDLDF :: PCLT_CompositeKey -> PCLT_ParamKey -> PCLT_CompositeKey -> SDL_DeterminationFailure SDLReferentialCycle_SDLDF :: PCLT_CompositeKey -> [PCLT_ID] -> SDL_DeterminationFailure ErrornousSDL_SDLDF :: PCLT_CompositeKey -> PCLT_ErrornousSDL -> SDL_DeterminationFailure -- | Type of PCSI2Text_Error. Stripping arguments. data PCSI2Text_Error_Type RequiredCompositeIsMissing_P2TET :: PCSI2Text_Error_Type RequiredCompositeLoclizationIsMissing_P2TET :: PCSI2Text_Error_Type CompositionCycle_P2TET :: PCSI2Text_Error_Type SDL_DeterminationFailure_P2TET :: SDL_DeterminationFailure_Type -> PCSI2Text_Error_Type UnsupportedMarker_P2TET :: PCSI2Text_Error_Type NoValueForParameter_P2TET :: PCSI2Text_Error_Type UnderAccordingParamReparsingFailure_P2TET :: PCSI2Text_Error_Type ReparsingDepthMaxReached_P2TET :: PCSI2Text_Error_Type ReparsingLengthMaxReached_P2TET :: PCSI2Text_Error_Type InstaniationLengthMaxReached_P2TET :: PCSI2Text_Error_Type -- | Type of SDL_DeterminationFailure. Stripping arguments. data SDL_DeterminationFailure_Type RequiredCompositeIsMissing_SDLDFT :: SDL_DeterminationFailure_Type MissingParam_SDLByParamCompositeLink_SDLDFT :: SDL_DeterminationFailure_Type WrongParamType_SDLByParamCompositeLink_SDLDFT :: SDL_DeterminationFailure_Type UnknownComposite_SDLByParamCompositeLink_SDLDFT :: SDL_DeterminationFailure_Type SDLReferentialCycle_SDLDFT :: SDL_DeterminationFailure_Type ErrornousSDL_SDLDFT :: SDL_DeterminationFailure_Type p2teType :: PCSI2Text_Error -> PCSI2Text_Error_Type sdldfType :: SDL_DeterminationFailure -> SDL_DeterminationFailure_Type -- | Template representation generation errors types abbreviations: -- --
--   RequiredCompositeIsMissing_P2TET            -> "CM"
--   RequiredCompositeLoclizationIsMissing_P2TET -> "CLM"
--   CompositionCycle_P2TET                      -> "CC"
--   SDL_DeterminationFailure_P2TET       sdldft -> "SF" ++
--       case sdldft of
--           RequiredCompositeIsMissing_SDLDFT               -> "(CM)"
--           MissingParam_SDLByParamCompositeLink_SDLDFT     -> "(LMP)"
--           WrongParamType_SDLByParamCompositeLink_SDLDFT   -> "(LWPT)"
--           UnknownComposite_SDLByParamCompositeLink_SDLDFT -> "(LUC)"
--           SDLReferentialCycle_SDLDFT                      -> "(CC)"
--           ErrornousSDL_SDLDFT                             -> "(ES)"
--   UnsupportedMarker_P2TET                     -> "UM"
--   NoValueForParameter_P2TET                   -> "NV"
--   UnderAccordingParamReparsingFailure_P2TET   -> "RF"
--   ReparsingDepthMaxReached_P2TET              -> "RDM"
--   ReparsingLengthMaxReached_P2TET             -> "RLM"
--   InstaniationLengthMaxReached_P2TET          -> "ILM"
--   
shortOf_PCSI2Text_Error :: PCSI2Text_Error -> ByteString -- | Whenever representation generator can't make representation for a -- template due to some error, it puts there (instead of representation) -- an error marking (pcsMarkingErrorPlaceholderWrapper) with an -- abbreviation (see shortOf_PCSI2Text_Error) of error type and -- template ID. includeAsAnError :: PCLT_InnerConfig -> PCSI2Text_Error -> String -> (ByteString, ForInstaniationUsedChunkLength) -- | A test, if a given reciever's detalization level is enough to -- represent a given PCSI. givenSDL_statisfies :: ShowDetalizationLevel -> PCSI -> PCLT_ShowDetalizationLevel -> PCLT_CatalogMap -> Either SDL_DeterminationFailure Bool type SpaceAvailableForPCSIInstaniation = MarkedChunkLength type ForInstaniationUsedChunkLength = MarkedChunkLength -- | Wrapper around pcsi2text for cases, when new CLBS for -- output is to be created. It's maximal length is set to be same as -- configured in parameter pcsInstaniationResultMaxSize pcsi2new_text :: PCSI -> (ShowDetalizationLevel, LanguageName) -> PCLT_Catalog -> (StdOut_CLBS, [ErrorWithPCSCatalog PCSI2Text_Error]) -- | Make a representation out of PCSI in specified detailization -- level, in specified language, using specified catalog. And append -- result to a specified CLBS. pcsi2text :: StdOut_CLBS -> PCSI -> (ShowDetalizationLevel, LanguageName) -> PCLT_Catalog -> (StdOut_CLBS, [ErrorWithPCSCatalog PCSI2Text_Error]) instance Typeable SDL_DeterminationFailure instance Typeable PCSI2Text_Error instance Show SDL_DeterminationFailure instance Show PCSI2Text_Error -- | WARNING: Creating an instance of ShowAsPCSI for String, -- ByteStrings and/or other text types is not recommended. Use -- of such instaniations would dread strictness of templates catalog -- structure - make it's use workaroundish, less systematic and less -- strict, which is a way to badmade applications. module Text.PCLT.ShowAsPCSI -- | Our extended version of Show class class ShowAsPCSI t showAsPCSI :: ShowAsPCSI t => t -> PCSI -- | This is a usual set for modules, that are to be imported by modules -- dedicated to declaring ShowAsPCSI and HasStaticRawPCLTs -- instances module Text.PCLT.SH__ -- | Addition to Text.PCLT.MakeMessage module. Some wrappers around -- pcsi2text function. module Text.PCLT.MakeMessage2 -- | Wrapper around pcsi2text_plus_errs_1 for cases, when new -- CLBS is to be created. It's maximal length is set to be same as -- configured in parameter pcsInstaniationResultMaxSize pcsi2new_text_plus_errs_1 :: PCSI -> (ShowDetalizationLevel, LanguageName) -> PCLT_Catalog -> StdOutAndErr_CLBS -- |
    --
  1. generates message from given PCSI
  2. --
  3. generates representation of errors list (that occurred, when doing -- step (1))
  4. --
  5. generates representation of errors list (that occurred, when doing -- step (2))
  6. --
  7. appends text result of step (3) to given CLBS
  8. --
  9. appends text result of step (2) to given CLBS
  10. --
  11. appends text result of step (1) to given CLBS
  12. --
pcsi2text_plus_errs_1 :: StdOutAndErr_CLBS -> PCSI -> (ShowDetalizationLevel, LanguageName) -> PCLT_Catalog -> StdOutAndErr_CLBS -- | Wrapper around pcsi2text_plus_errs_2 for cases, when new -- CLBSs are to be created: -- -- pcsi2new_text_plus_errs_2 :: Int64 -> PCSI -> (ShowDetalizationLevel, LanguageName) -> PCLT_Catalog -> (StdOut_CLBS, StdErr_CLBS) -- |
    --
  1. generates message from given PCSI
  2. --
  3. appends text result of step (1) to given CLBS_1
  4. --
  5. generates representation of errors list (that occurred, when doing -- step (1))
  6. --
  7. generates representation of errors list (that occurred, when doing -- step (3))
  8. --
  9. appends text result of step (4) to given CLBS_2
  10. --
  11. appends text result of step (3) to given CLBS_2
  12. --
pcsi2text_plus_errs_2 :: (StdOut_CLBS, StdErr_CLBS) -> PCSI -> (ShowDetalizationLevel, LanguageName) -> PCLT_Catalog -> (StdOut_CLBS, StdErr_CLBS) -- | Tools to use HasStaticRawPCLTs class instances in order to -- build up a catalog. ("FromHSRT" in module name means from a given -- instance of HasStaticRawPCLTs class) module Text.PCLT.CatalogFromHSRT data CatalogFromHSRTInitErrors CatalogFromHSRTInitErrors :: PCLT_CatalogID -> [ErrorWithPCSCatalog ReadPCSCatalogError] -> [AddPCLT_toPCLT_Error] -> CatalogFromHSRTInitErrors cfhieCatalogID :: CatalogFromHSRTInitErrors -> PCLT_CatalogID cfhieCatReadErrs :: CatalogFromHSRTInitErrors -> [ErrorWithPCSCatalog ReadPCSCatalogError] cfhieCollectionErrs :: CatalogFromHSRTInitErrors -> [AddPCLT_toPCLT_Error] defaultCatalogFromHSRTInitErrors :: PCLT_CatalogID -> CatalogFromHSRTInitErrors initCatalogFromHSRT :: HasStaticRawPCLTs a => a -> PCLT_InnerConfig -> PCLT_CatalogID -> (PCLT_Catalog, CatalogFromHSRTInitErrors) -- | A wrapper around initCatalogFromHSRT function. For case, when -- all errors are to be represented at once. initCatalogFromHSRT_2 :: HasStaticRawPCLTs a => a -> PCLT_InnerConfig -> PCLT_CatalogID -> (StdErr_CLBS, ShowDetalizationLevel, LanguageName) -> (PCLT_Catalog, StdErr_CLBS) addFromHSRTToCatalog :: HasStaticRawPCLTs a => a -> PCLT_Catalog -> (PCLT_Catalog, CatalogFromHSRTInitErrors) -- | A wrapper around addFromHSRTToCatalog function. For case, when -- all errors are to be represented at once. addFromHSRTToCatalog_2 :: HasStaticRawPCLTs a => a -> PCLT_Catalog -> (StdErr_CLBS, ShowDetalizationLevel, LanguageName) -> (PCLT_Catalog, StdErr_CLBS) instance Typeable CatalogFromHSRTInitErrors instance Show CatalogFromHSRTInitErrors instance ShowAsPCSI CatalogFromHSRTInitErrors module Text.PCLT.InitialDefaultCatalog -- | This type is a special instance of HasStaticRawPCLTs - it -- accumulates all other instances of HasStaticRawPCLTs from the -- whole PCLT package data PCLTRawCatalog__Text_PCLT_InitialDefaultCatalog PCLTRawCatalog__Text_PCLT_InitialDefaultCatalog :: PCLTRawCatalog__Text_PCLT_InitialDefaultCatalog initDefaultCatalog :: PCLT_InnerConfig -> PCLT_CatalogID -> (PCLT_Catalog, CatalogFromHSRTInitErrors) initDefaultCatalog_2 :: PCLT_InnerConfig -> PCLT_CatalogID -> (StdErr_CLBS, ShowDetalizationLevel, LanguageName) -> (PCLT_Catalog, StdErr_CLBS) initDefaultCatalog_3 :: PCLT_CatalogID -> (StdErr_CLBS, ShowDetalizationLevel, LanguageName) -> (PCLT_Catalog, StdErr_CLBS) instance HasStaticRawPCLTs PCLTRawCatalog__Text_PCLT_InitialDefaultCatalog -- | This is thought to be imported outside of PCLT package by modules, -- that use PCLT logics (catalog formation routines and messages -- generation routines) -- -- And another briefing on what is PCLT. First is in the top level of -- Haddock documentation provided for the package. -- -- _______________ -- --
--   export "Text.PCLT.SH__"
--   
-- -- This module provides interfaces to the classes ShowAsPCSI and -- HasStaticRawPCLTs an all the routines, that usually are used -- for declaration of their instanitations. -- -- _______________ -- --
--   export "Text.ConstraintedLBS"
--   
-- -- A constrainting (the constraint here is on it's size) wrapper for a -- lazy ByteString (LBS) - this container is used for messages -- generated from PCLT templates -- -- _______________ -- --
--   export "Text.PCLT.InitialDefaultCatalog"
--   
-- --
--   initDefaultCatalog_3 :: Text.PCLT.Catalog.PCLT_CatalogID -> (StdErr_CLBS, ShowDetalizationLevel, LanguageName) -> (PCLT_Catalog, StdErr_CLBS)
--   
-- -- _______________ -- --
--   export "Text.PCLT.Catalog"
--   
-- -- Catalog is a unit with 3 fields: catalog ID, config, and a map by -- template_IDs of templates, where each template is: minimal SDL -- required to represent message from this template, and a maps by -- languages of localized templates. -- -- _______________ -- --
--   export "Text.PCLT.CatalogFromHSRT"
--   
-- -- We want to add to the default catalog some our application specific -- entries (templates) -- --
--   addFromHSRTToCatalog_2 :: HasStaticRawPCLTs a => a -> PCLT_Catalog -> (StdErr_CLBS, ShowDetalizationLevel, LanguageName) -> (PCLT_Catalog, StdErr_CLBS)
--   
-- -- _______________ -- --
--   export "Text.PCLT.CommonTypes"
--   
-- -- Some type aliases, like LanguageName = String -- -- _______________ -- --
--   export "Text.PCLT.Config"
--   
-- -- Configuration that influences the behaviour of catalog formation -- routines and messages generation routines. -- -- _______________ -- --
--   export "Text.PCLT.MakeMessage"
--   
-- -- PCSI(template_id + params) + language_name + recepient_SDL + catalog -- >---(Text.PCLT.MakeMessage)---> message -- -- _______________ -- --
--   export "Text.PCLT.MakeMessage2"
--   
-- -- Some comfort wrappers for Text.PCLT.MakeMessage -- -- _______________ -- --
--   export "Text.PCLT.SDL"
--   
-- -- SDL (Show Detalization Level) is a 1-dimensional variable type, built -- on Int, but extended with additional values: -- -- Zero_SDL (absolute minimal level) < One_SDL -- (minimal something) < SDL Int < InfinitelyBig_SDL -- -- With SDL we regulate, how much some Reader (of our generated messages) -- wishes (is allowed) to see. -- -- _______________ -- --
--   export "Text.PCLT.ShowAsPCSI__"
--   
-- -- Some general instances of ShowAsPCSI class are to be found here -- (Bool, ShowAsPCSI a => Maybe a, SomeException) module Text.PCLT data SeparatedSectorMarker_PCSIWrapped SeparatedSectorMarker_PCSIWrapped :: SeparatedSectorMarker -> SeparatedSectorMarker_PCSIWrapped data StandartMarkingStrategyError_PCSIWrapped StandartMarkingStrategyError_PCSIWrapped :: StandartMarkingStrategyError -> StandartMarkingStrategyError_PCSIWrapped data PCLTRawCatalog__Text_PCLT_ShowAsPCSI_GeneralCommons PCLTRawCatalog__Text_PCLT_ShowAsPCSI_GeneralCommons :: PCLTRawCatalog__Text_PCLT_ShowAsPCSI_GeneralCommons data PCLTRawCatalog__Text_PCLT_ShowAsPCSI PCLTRawCatalog__Text_PCLT_ShowAsPCSI :: PCLTRawCatalog__Text_PCLT_ShowAsPCSI