Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- toJsonText :: ToJSON a => a -> Text
- writeJsonFile :: ToJSON a => FilePath -> a -> IO ()
- readJsonFile :: FromJSON a => FilePath -> IO a
Instances
Utilities
toJsonText :: ToJSON a => a -> Text Source #
Show a JSON-convertible haskell value as pretty-printed JSON text.
writeJsonFile :: ToJSON a => FilePath -> a -> IO () Source #
Write a JSON-convertible haskell value to a pretty-printed JSON file. Eg: writeJsonFile "a.json" nulltransaction
readJsonFile :: FromJSON a => FilePath -> IO a Source #
Read a JSON file and decode it to the target type, or raise an error if we can't. Eg: readJsonFile "a.json" :: IO Transaction