on master help sign in
Merge pull request #111 from glguy/config-export-list

Add export list to Graphics.Vty.Config to avoid leaking implementation details of parser

commit5208cc0790cfd14422684df230bbc1c4fcde5f38 authorJonathan Daugherty <cygnus@foobox.com> dateFri 2 Sep 2016, 18:57 (10 years ago) parent9fb9c543d0d693
1 file changed+13−3
src/Graphics/Vty/Config.hs+13−3
src/Graphics/Vty/Config.hs+13−3
@@ -64,7 +64,15 @@
6464-- Set VTY_DEBUG_LOG. Run vty. Check debug log for incorrect mappings. Add corrected mappings to
6565-- .vty/config
6666--
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
6876
6977#if __GLASGOW_HASKELL__ > 704
7078import Prelude
@@ -182,14 +190,16 @@ parseConfigFile path = do
182190 catch (runParseConfig path <$> BS.readFile path)
183191 (\(_ :: IOException) -> return def)
184192
185−type Parser = Parsec BS.ByteString ()
186−
187193runParseConfig :: String -> BS.ByteString -> Config
188194runParseConfig name cfgTxt =
189195 case runParser parseConfig () name cfgTxt of
190196 Right cfg -> cfg
191197 Left{} -> def
192198
199+------------------------------------------------------------------------
200+
201+type Parser = Parsec BS.ByteString ()
202+
193203-- I tried to use the haskellStyle here but that was specialized (without requirement?) to the
194204-- String stream type.
195205configLanguage :: Monad m => P.GenLanguageDef BS.ByteString () m