aboutsummaryrefslogtreecommitdiffstats
path: root/src/VeriFuzz/Config.hs
diff options
context:
space:
mode:
authorYann Herklotz Grave <git@yannherklotzgrave.com>2019-03-04 16:53:36 +0000
committerYann Herklotz Grave <git@yannherklotzgrave.com>2019-03-04 16:53:36 +0000
commitf53478a6d5cf37d61cdfee399984ae0f1bbd29e2 (patch)
tree1afe559cf9546f93fdbb294a73e259752d8606bf /src/VeriFuzz/Config.hs
parent02f599e3d5b54b7d033d4d75db45ab379fe343c9 (diff)
downloadverismith-f53478a6d5cf37d61cdfee399984ae0f1bbd29e2.tar.gz
verismith-f53478a6d5cf37d61cdfee399984ae0f1bbd29e2.zip
Run formatting on Config.hs
Diffstat (limited to 'src/VeriFuzz/Config.hs')
-rw-r--r--src/VeriFuzz/Config.hs18
1 files changed, 12 insertions, 6 deletions
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