on master help sign in
Merge pull request #111 from glguy/config-export-list
5208cc0Jonathan Daugherty
src/Graphics/Vty/Config.hs+13−3
@@ -64,7 +64,15 @@
64-- Set VTY_DEBUG_LOG. Run vty. Check debug log for incorrect mappings. Add corrected mappings to
64-- Set VTY_DEBUG_LOG. Run vty. Check debug log for incorrect mappings. Add corrected mappings to
65-- .vty/config
65-- .vty/config
66--
66--
67−module Graphics.Vty.Config where
67+module Graphics.Vty.Config
68+ ( InputMap
69+ , Config(..)
70+ , userConfig
71+ , overrideEnvConfig
72+ , standardIOConfig
73+ , runParseConfig
74+ , parseConfigFile
75+ ) where
68
76
69#if __GLASGOW_HASKELL__ > 704
77#if __GLASGOW_HASKELL__ > 704
70import Prelude
78import Prelude
@@ -182,14 +190,16 @@ parseConfigFile path = do
182 catch (runParseConfig path <$> BS.readFile path)
190 catch (runParseConfig path <$> BS.readFile path)
183 (\(_ :: IOException) -> return def)
191 (\(_ :: IOException) -> return def)
184
192
185−type Parser = Parsec BS.ByteString ()
186−
187runParseConfig :: String -> BS.ByteString -> Config
193runParseConfig :: String -> BS.ByteString -> Config
188runParseConfig name cfgTxt =
194runParseConfig name cfgTxt =
189 case runParser parseConfig () name cfgTxt of
195 case runParser parseConfig () name cfgTxt of
190 Right cfg -> cfg
196 Right cfg -> cfg
191 Left{} -> def
197 Left{} -> def
192
198
199+------------------------------------------------------------------------
200+
201+type Parser = Parsec BS.ByteString ()
202+
193-- I tried to use the haskellStyle here but that was specialized (without requirement?) to the
203-- I tried to use the haskellStyle here but that was specialized (without requirement?) to the
194-- String stream type.
204-- String stream type.
195configLanguage :: Monad m => P.GenLanguageDef BS.ByteString () m
205configLanguage :: Monad m => P.GenLanguageDef BS.ByteString () m