module Text.XML.HXT.Arrow.XmlState.SystemConfig
where
import Control.Arrow
import Data.Map ( insert )
import Text.XML.HXT.DOM.Interface
import Text.XML.HXT.Arrow.XmlState.ErrorHandling
import Text.XML.HXT.Arrow.XmlState.TypeDefs
withTrace :: Int -> SysConfig
withTrace :: Int -> SysConfig
withTrace = Selector XIOSysState Int -> Int -> SysConfig
forall s a. Selector s a -> a -> s -> s
setS Selector XIOSysState Int
theTraceLevel
withSysAttr :: String -> String -> SysConfig
withSysAttr :: String -> String -> SysConfig
withSysAttr String
n String
v = Selector XIOSysState Attributes
-> (Attributes -> Attributes) -> SysConfig
forall s a. Selector s a -> (a -> a) -> s -> s
chgS Selector XIOSysState Attributes
theAttrList (String -> String -> Attributes -> Attributes
forall k v. Eq k => k -> v -> AssocList k v -> AssocList k v
addEntry String
n String
v)
withAcceptedMimeTypes :: [String] -> SysConfig
withAcceptedMimeTypes :: [String] -> SysConfig
withAcceptedMimeTypes = Selector XIOSysState [String] -> [String] -> SysConfig
forall s a. Selector s a -> a -> s -> s
setS Selector XIOSysState [String]
theAcceptedMimeTypes
withMimeTypeHandler :: String -> IOSArrow XmlTree XmlTree -> SysConfig
withMimeTypeHandler :: String -> IOSArrow XmlTree XmlTree -> SysConfig
withMimeTypeHandler String
mt IOSArrow XmlTree XmlTree
pa = Selector XIOSysState MimeTypeHandlers
-> (MimeTypeHandlers -> MimeTypeHandlers) -> SysConfig
forall s a. Selector s a -> (a -> a) -> s -> s
chgS Selector XIOSysState MimeTypeHandlers
theMimeTypeHandlers ((MimeTypeHandlers -> MimeTypeHandlers) -> SysConfig)
-> (MimeTypeHandlers -> MimeTypeHandlers) -> SysConfig
forall a b. (a -> b) -> a -> b
$ String
-> IOSArrow XmlTree XmlTree -> MimeTypeHandlers -> MimeTypeHandlers
forall k a. Ord k => k -> a -> Map k a -> Map k a
insert String
mt IOSArrow XmlTree XmlTree
pa
withMimeTypeFile :: String -> SysConfig
withMimeTypeFile :: String -> SysConfig
withMimeTypeFile = Selector XIOSysState String -> String -> SysConfig
forall s a. Selector s a -> a -> s -> s
setS Selector XIOSysState String
theMimeTypeFile
withFileMimeType :: String -> SysConfig
withFileMimeType :: String -> SysConfig
withFileMimeType = Selector XIOSysState String -> String -> SysConfig
forall s a. Selector s a -> a -> s -> s
setS Selector XIOSysState String
theFileMimeType
withWarnings :: Bool -> SysConfig
withWarnings :: Bool -> SysConfig
withWarnings = Selector XIOSysState Bool -> Bool -> SysConfig
forall s a. Selector s a -> a -> s -> s
setS Selector XIOSysState Bool
theWarnings
withErrors :: Bool -> SysConfig
withErrors :: Bool -> SysConfig
withErrors Bool
b = Selector XIOSysState (String -> IO ())
-> (String -> IO ()) -> SysConfig
forall s a. Selector s a -> a -> s -> s
setS Selector XIOSysState (String -> IO ())
theErrorMsgHandler String -> IO ()
h
where
h :: String -> IO ()
h | Bool
b = String -> IO ()
errorOutputToStderr
| Bool
otherwise = IO () -> String -> IO ()
forall a b. a -> b -> a
const (IO () -> String -> IO ()) -> IO () -> String -> IO ()
forall a b. (a -> b) -> a -> b
$ () -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
withRemoveWS :: Bool -> SysConfig
withRemoveWS :: Bool -> SysConfig
withRemoveWS = Selector XIOSysState Bool -> Bool -> SysConfig
forall s a. Selector s a -> a -> s -> s
setS Selector XIOSysState Bool
theRemoveWS
withPreserveComment :: Bool -> SysConfig
= Selector XIOSysState Bool -> Bool -> SysConfig
forall s a. Selector s a -> a -> s -> s
setS Selector XIOSysState Bool
thePreserveComment
withParseByMimeType :: Bool -> SysConfig
withParseByMimeType :: Bool -> SysConfig
withParseByMimeType = Selector XIOSysState Bool -> Bool -> SysConfig
forall s a. Selector s a -> a -> s -> s
setS Selector XIOSysState Bool
theParseByMimeType
withParseHTML :: Bool -> SysConfig
withParseHTML :: Bool -> SysConfig
withParseHTML = Selector XIOSysState Bool -> Bool -> SysConfig
forall s a. Selector s a -> a -> s -> s
setS Selector XIOSysState Bool
theParseHTML
withValidate :: Bool -> SysConfig
withValidate :: Bool -> SysConfig
withValidate = Selector XIOSysState Bool -> Bool -> SysConfig
forall s a. Selector s a -> a -> s -> s
setS Selector XIOSysState Bool
theValidate
withSubstDTDEntities :: Bool -> SysConfig
withSubstDTDEntities :: Bool -> SysConfig
withSubstDTDEntities = Selector XIOSysState Bool -> Bool -> SysConfig
forall s a. Selector s a -> a -> s -> s
setS Selector XIOSysState Bool
theSubstDTDEntities
withSubstHTMLEntities :: Bool -> SysConfig
withSubstHTMLEntities :: Bool -> SysConfig
withSubstHTMLEntities = Selector XIOSysState Bool -> Bool -> SysConfig
forall s a. Selector s a -> a -> s -> s
setS Selector XIOSysState Bool
theSubstHTMLEntities
withCheckNamespaces :: Bool -> SysConfig
withCheckNamespaces :: Bool -> SysConfig
withCheckNamespaces = Selector XIOSysState Bool -> Bool -> SysConfig
forall s a. Selector s a -> a -> s -> s
setS Selector XIOSysState Bool
theCheckNamespaces
withCanonicalize :: Bool -> SysConfig
withCanonicalize :: Bool -> SysConfig
withCanonicalize = Selector XIOSysState Bool -> Bool -> SysConfig
forall s a. Selector s a -> a -> s -> s
setS Selector XIOSysState Bool
theCanonicalize
withIgnoreNoneXmlContents :: Bool -> SysConfig
withIgnoreNoneXmlContents :: Bool -> SysConfig
withIgnoreNoneXmlContents = Selector XIOSysState Bool -> Bool -> SysConfig
forall s a. Selector s a -> a -> s -> s
setS Selector XIOSysState Bool
theIgnoreNoneXmlContents
withStrictInput :: Bool -> SysConfig
withStrictInput :: Bool -> SysConfig
withStrictInput = Selector XIOSysState Bool -> Bool -> SysConfig
forall s a. Selector s a -> a -> s -> s
setS Selector XIOSysState Bool
theStrictInput
withEncodingErrors :: Bool -> SysConfig
withEncodingErrors :: Bool -> SysConfig
withEncodingErrors = Selector XIOSysState Bool -> Bool -> SysConfig
forall s a. Selector s a -> a -> s -> s
setS Selector XIOSysState Bool
theEncodingErrors
withInputEncoding :: String -> SysConfig
withInputEncoding :: String -> SysConfig
withInputEncoding = Selector XIOSysState String -> String -> SysConfig
forall s a. Selector s a -> a -> s -> s
setS Selector XIOSysState String
theInputEncoding
withDefaultBaseURI :: String -> SysConfig
withDefaultBaseURI :: String -> SysConfig
withDefaultBaseURI = Selector XIOSysState String -> String -> SysConfig
forall s a. Selector s a -> a -> s -> s
setS Selector XIOSysState String
theDefaultBaseURI
withInputOption :: String -> String -> SysConfig
withInputOption :: String -> String -> SysConfig
withInputOption String
n String
v = Selector XIOSysState Attributes
-> (Attributes -> Attributes) -> SysConfig
forall s a. Selector s a -> (a -> a) -> s -> s
chgS Selector XIOSysState Attributes
theInputOptions (String -> String -> Attributes -> Attributes
forall k v. Eq k => k -> v -> AssocList k v -> AssocList k v
addEntry String
n String
v)
withInputOptions :: Attributes -> SysConfig
withInputOptions :: Attributes -> SysConfig
withInputOptions = (SysConfig -> SysConfig -> SysConfig)
-> SysConfig -> [SysConfig] -> SysConfig
forall a b. (a -> b -> b) -> b -> [a] -> b
forall (t :: * -> *) a b.
Foldable t =>
(a -> b -> b) -> b -> t a -> b
foldr SysConfig -> SysConfig -> SysConfig
forall {k} (cat :: k -> k -> *) (a :: k) (b :: k) (c :: k).
Category cat =>
cat a b -> cat b c -> cat a c
(>>>) SysConfig
forall a. a -> a
id ([SysConfig] -> SysConfig)
-> (Attributes -> [SysConfig]) -> Attributes -> SysConfig
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((String, String) -> SysConfig) -> Attributes -> [SysConfig]
forall a b. (a -> b) -> [a] -> [b]
map ((String -> String -> SysConfig) -> (String, String) -> SysConfig
forall a b c. (a -> b -> c) -> (a, b) -> c
uncurry String -> String -> SysConfig
withInputOption)
withRedirect :: Bool -> SysConfig
withRedirect :: Bool -> SysConfig
withRedirect = Selector XIOSysState Bool -> Bool -> SysConfig
forall s a. Selector s a -> a -> s -> s
setS Selector XIOSysState Bool
theRedirect
withProxy :: String -> SysConfig
withProxy :: String -> SysConfig
withProxy = Selector XIOSysState String -> String -> SysConfig
forall s a. Selector s a -> a -> s -> s
setS Selector XIOSysState String
theProxy
withIndent :: Bool -> SysConfig
withIndent :: Bool -> SysConfig
withIndent = Selector XIOSysState Bool -> Bool -> SysConfig
forall s a. Selector s a -> a -> s -> s
setS Selector XIOSysState Bool
theIndent
withOutputEncoding :: String -> SysConfig
withOutputEncoding :: String -> SysConfig
withOutputEncoding = Selector XIOSysState String -> String -> SysConfig
forall s a. Selector s a -> a -> s -> s
setS Selector XIOSysState String
theOutputEncoding
withOutputXML :: SysConfig
withOutputXML :: SysConfig
withOutputXML = Selector XIOSysState XIOXoutConfig -> XIOXoutConfig -> SysConfig
forall s a. Selector s a -> a -> s -> s
setS Selector XIOSysState XIOXoutConfig
theOutputFmt XIOXoutConfig
XMLoutput
withOutputHTML :: SysConfig
withOutputHTML :: SysConfig
withOutputHTML = Selector XIOSysState XIOXoutConfig -> XIOXoutConfig -> SysConfig
forall s a. Selector s a -> a -> s -> s
setS Selector XIOSysState XIOXoutConfig
theOutputFmt XIOXoutConfig
HTMLoutput
withOutputXHTML :: SysConfig
withOutputXHTML :: SysConfig
withOutputXHTML = Selector XIOSysState XIOXoutConfig -> XIOXoutConfig -> SysConfig
forall s a. Selector s a -> a -> s -> s
setS Selector XIOSysState XIOXoutConfig
theOutputFmt XIOXoutConfig
XHTMLoutput
withOutputPLAIN :: SysConfig
withOutputPLAIN :: SysConfig
withOutputPLAIN = Selector XIOSysState XIOXoutConfig -> XIOXoutConfig -> SysConfig
forall s a. Selector s a -> a -> s -> s
setS Selector XIOSysState XIOXoutConfig
theOutputFmt XIOXoutConfig
PLAINoutput
withXmlPi :: Bool -> SysConfig
withXmlPi :: Bool -> SysConfig
withXmlPi = Selector XIOSysState Bool -> Bool -> SysConfig
forall s a. Selector s a -> a -> s -> s
setS Selector XIOSysState Bool
theXmlPi
withNoEmptyElemFor :: [String] -> SysConfig
withNoEmptyElemFor :: [String] -> SysConfig
withNoEmptyElemFor = Selector XIOSysState [String] -> [String] -> SysConfig
forall s a. Selector s a -> a -> s -> s
setS Selector XIOSysState [String]
theNoEmptyElemFor
withAddDefaultDTD :: Bool -> SysConfig
withAddDefaultDTD :: Bool -> SysConfig
withAddDefaultDTD = Selector XIOSysState Bool -> Bool -> SysConfig
forall s a. Selector s a -> a -> s -> s
setS Selector XIOSysState Bool
theAddDefaultDTD
withTextMode :: Bool -> SysConfig
withTextMode :: Bool -> SysConfig
withTextMode = Selector XIOSysState Bool -> Bool -> SysConfig
forall s a. Selector s a -> a -> s -> s
setS Selector XIOSysState Bool
theTextMode
withShowTree :: Bool -> SysConfig
withShowTree :: Bool -> SysConfig
withShowTree = Selector XIOSysState Bool -> Bool -> SysConfig
forall s a. Selector s a -> a -> s -> s
setS Selector XIOSysState Bool
theShowTree
withShowHaskell :: Bool -> SysConfig
withShowHaskell :: Bool -> SysConfig
withShowHaskell = Selector XIOSysState Bool -> Bool -> SysConfig
forall s a. Selector s a -> a -> s -> s
setS Selector XIOSysState Bool
theShowHaskell
withCompression :: (CompressionFct, DeCompressionFct) -> SysConfig
withCompression :: (CompressionFct, CompressionFct) -> SysConfig
withCompression = Selector XIOSysState (CompressionFct, CompressionFct)
-> (CompressionFct, CompressionFct) -> SysConfig
forall s a. Selector s a -> a -> s -> s
setS (Selector XIOSysState CompressionFct
theBinaryCompression Selector XIOSysState CompressionFct
-> Selector XIOSysState CompressionFct
-> Selector XIOSysState (CompressionFct, CompressionFct)
forall s a b. Selector s a -> Selector s b -> Selector s (a, b)
.&&&. Selector XIOSysState CompressionFct
theBinaryDeCompression)
withStrictDeserialize :: Bool -> SysConfig
withStrictDeserialize :: Bool -> SysConfig
withStrictDeserialize = Selector XIOSysState Bool -> Bool -> SysConfig
forall s a. Selector s a -> a -> s -> s
setS Selector XIOSysState Bool
theStrictDeserialize
yes :: Bool
yes :: Bool
yes = Bool
True
no :: Bool
no :: Bool
no = Bool
False