Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Data.Yaml.Marked.Parse
Contents
Synopsis
- withObject :: String -> (MarkedObject -> Either String a) -> Marked Value -> Either String (Marked a)
- withArray :: String -> (MarkedArray -> Either String a) -> Marked Value -> Either String (Marked a)
- withText :: String -> (Text -> Either String a) -> Marked Value -> Either String (Marked a)
- withScientific :: String -> (Scientific -> Either String a) -> Marked Value -> Either String (Marked a)
- withBool :: String -> (Bool -> Either String a) -> Marked Value -> Either String (Marked a)
- (.:) :: MarkedObject -> Key -> Either String (Marked Value)
- (.:?) :: MarkedObject -> Key -> Either String (Maybe (Marked Value))
- array :: (Marked Value -> Either String (Marked a)) -> Marked Value -> Either String (Marked [Marked a])
- json :: FromJSON a => Marked Value -> Either String (Marked a)
- value :: Marked Value -> Either String (Marked Value)
- text :: Marked Value -> Either String (Marked Text)
- double :: Marked Value -> Either String (Marked Double)
- int :: Marked Value -> Either String (Marked Int)
- bool :: Marked Value -> Either String (Marked Bool)
- withPrependedPath :: (val -> Either String a) -> Marked val -> Either String (Marked a)
Documentation
withObject :: String -> (MarkedObject -> Either String a) -> Marked Value -> Either String (Marked a) Source #
withArray :: String -> (MarkedArray -> Either String a) -> Marked Value -> Either String (Marked a) Source #
withText :: String -> (Text -> Either String a) -> Marked Value -> Either String (Marked a) Source #
withScientific :: String -> (Scientific -> Either String a) -> Marked Value -> Either String (Marked a) Source #
withBool :: String -> (Bool -> Either String a) -> Marked Value -> Either String (Marked a) Source #
array :: (Marked Value -> Either String (Marked a)) -> Marked Value -> Either String (Marked [Marked a]) Source #
json :: FromJSON a => Marked Value -> Either String (Marked a) Source #
Parse the value using its FromJSON
instance, passing along the marks
Lower-level
withPrependedPath :: (val -> Either String a) -> Marked val -> Either String (Marked a) Source #
Prepend an error with an item's markedJSONPath
, when present
All of the functions above do this already. You would only need this if you're writing something that doesn't us them.