remove the symbol helpers
Getty Ritter
3 years ago
256 | 256 | Integer i -> k (fromIntegral i) |
257 | 257 | _ -> Left ("Expected double in " ++ n) |
258 | 258 | |
259 | withSymbol :: String -> (T.Text -> Parser a) -> Value -> Parser a | |
260 | withSymbol n k val = case val of | |
261 | Symbol s -> k s | |
262 | _ -> Left ("Expected symbol in " ++ n) | |
263 | ||
264 | 259 | withString :: String -> (T.Text -> Parser a) -> Value -> Parser a |
265 | 260 | withString n k val = case val of |
266 | 261 | String s -> k s |
414 | 409 | go _ _ = Left "Invalid Either" |
415 | 410 | |
416 | 411 | instance FromAdnot Bool where |
417 |
parseAdnot = withS |
|
412 | parseAdnot = withString "Bool" go | |
418 | 413 | where go "True" = return True |
419 | 414 | go "False" = return False |
420 | 415 | go _ = Left "Invalid Bool" |