From e3cafcd9a1fc8621fdaaf33d1772bdcd8390d2bf Mon Sep 17 00:00:00 2001 From: stuebinm Date: Thu, 6 Jun 2024 20:16:09 +0200 Subject: add yaml source --- src/Conftrack/Value.hs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/Conftrack/Value.hs') diff --git a/src/Conftrack/Value.hs b/src/Conftrack/Value.hs index f934d51..5c8d949 100644 --- a/src/Conftrack/Value.hs +++ b/src/Conftrack/Value.hs @@ -35,7 +35,7 @@ prefixedWith (Key key) prefix = Key (prependList prefix key) data ConfigError = ParseError Text | TypeMismatch Text Value - | NotPresent + | NotPresent Key | Shadowed deriving Show @@ -53,6 +53,10 @@ instance ConfigValue Integer where fromConfig (ConfigInteger a) = Right a fromConfig val = Left (TypeMismatch "integer" val) +instance ConfigValue Int where + fromConfig (ConfigInteger a) = Right (fromInteger a) + fromConfig val = Left (TypeMismatch "integer" val) + instance ConfigValue Bool where fromConfig (ConfigBool b) = Right b fromConfig val = Left (TypeMismatch "bool" val) -- cgit v1.2.3