gdritter repos adnot / 0f926c3
remove the symbol helpers Getty Ritter 3 years ago
1 changed file(s) with 1 addition(s) and 6 deletion(s). Collapse all Expand all
256256 Integer i -> k (fromIntegral i)
257257 _ -> Left ("Expected double in " ++ n)
258258
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
264259 withString :: String -> (T.Text -> Parser a) -> Value -> Parser a
265260 withString n k val = case val of
266261 String s -> k s
414409 go _ _ = Left "Invalid Either"
415410
416411 instance FromAdnot Bool where
417 parseAdnot = withSymbol "Bool" go
412 parseAdnot = withString "Bool" go
418413 where go "True" = return True
419414 go "False" = return False
420415 go _ = Left "Invalid Bool"