-- 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: -- --
-- 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: -- --
-- 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
--
-- -- 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 -- |
-- 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