diff options
author | stuebinm | 2024-06-06 20:16:09 +0200 |
---|---|---|
committer | stuebinm | 2024-06-06 20:24:15 +0200 |
commit | e3cafcd9a1fc8621fdaaf33d1772bdcd8390d2bf (patch) | |
tree | 1a8c593c18c4e0477dd8277da6240a4eceecbc00 /src/Conftrack/Value.hs | |
parent | 4321bb0b5b90c0f92217ccd07a67f17fce44b388 (diff) |
add yaml source
Diffstat (limited to '')
-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) |