json-directory-0.1.0.0: Load JSON from files in a directory structure

Safe HaskellNone
LanguageHaskell2010

Data.JSON.Directory

Synopsis

Documentation

decodeDirectory :: (FromJSON a, MonadIO io) => FilePath -> io (Either String a) Source #

Takes a directory and decodes it using a FromJSON instance. Each entry in the directory becomes a key, and the contents become the corresponding value.

  • Directories are recursed into.
  • Files ending in .json are decoded as JSON values.
  • Everything else is assumed to be a valid unicode string.

This function can throw IO exceptions as well as a ModifiedWhileReading exception if the modification time changes during processing.