diff options
Diffstat (limited to 'src/Conftrack/Value.hs')
-rw-r--r-- | src/Conftrack/Value.hs | 6 |
1 files changed, 5 insertions, 1 deletions
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) |