From f53478a6d5cf37d61cdfee399984ae0f1bbd29e2 Mon Sep 17 00:00:00 2001 From: Yann Herklotz Grave Date: Mon, 4 Mar 2019 16:53:36 +0000 Subject: Run formatting on Config.hs --- src/VeriFuzz/Config.hs | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'src/VeriFuzz') diff --git a/src/VeriFuzz/Config.hs b/src/VeriFuzz/Config.hs index a51743e..b5a66eb 100644 --- a/src/VeriFuzz/Config.hs +++ b/src/VeriFuzz/Config.hs @@ -41,17 +41,23 @@ newtype Config = Config { _configProbability :: Probability } makeLenses ''Config defaultValue - :: (Alternative r, Applicative w) => - b -> Toml.Codec r w a b -> Toml.Codec r w a b + :: (Alternative r, Applicative w) + => b + -> Toml.Codec r w a b + -> Toml.Codec r w a b defaultValue x = Toml.dimap Just (fromMaybe x) . Toml.dioptional probCodec :: TomlCodec Probability -probCodec = Probability - <$> Toml.int "assign" .= _probAssign - <*> defaultValue 1 (Toml.int "always") .= _probAlways +probCodec = + Probability + <$> Toml.int "assign" + .= _probAssign + <*> defaultValue 1 (Toml.int "always") + .= _probAlways configCodec :: TomlCodec Config -configCodec = Toml.dimap _configProbability Config $ Toml.table probCodec "probability" +configCodec = + Toml.dimap _configProbability Config $ Toml.table probCodec "probability" parseConfigFile :: FilePath -> IO Config parseConfigFile = Toml.decodeFile configCodec -- cgit