Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- decodeDirectory :: (FromJSON a, MonadIO io) => FilePath -> io (Either String a)
- decodeDirectory' :: (FromJSON a, MonadIO io) => [Rule] -> FilePath -> io (Either String a)
- data Rule = Rule {}
- data IResult a
- defaultRules :: [Rule]
- jsonRule :: Rule
- textRule :: Rule
- idecodeStrict :: FromJSON a => ByteString -> IResult a
- data ModifiedWhileReading
- data NoRuleFor
Documentation
decodeDirectory :: (FromJSON a, MonadIO io) => FilePath -> io (Either String a) Source #
Takes a directory and decodes it using a
instance.
Each entry in the directory becomes a key, and the contents become
the corresponding value.FromJSON
- 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
exception if the modification time changes during processing.ModifiedWhileReading
Uses defaultRules
decodeDirectory' :: (FromJSON a, MonadIO io) => [Rule] -> FilePath -> io (Either String a) Source #
Like
but you get to specify the rules.decodeDirectory
How to interpret a file.
The internal result of running a Parser
.
Instances
MonadFail IResult | |
Defined in Data.Aeson.Types.Internal | |
Foldable IResult | |
Defined in Data.Aeson.Types.Internal fold :: Monoid m => IResult m -> m # foldMap :: Monoid m => (a -> m) -> IResult a -> m # foldMap' :: Monoid m => (a -> m) -> IResult a -> m # foldr :: (a -> b -> b) -> b -> IResult a -> b # foldr' :: (a -> b -> b) -> b -> IResult a -> b # foldl :: (b -> a -> b) -> b -> IResult a -> b # foldl' :: (b -> a -> b) -> b -> IResult a -> b # foldr1 :: (a -> a -> a) -> IResult a -> a # foldl1 :: (a -> a -> a) -> IResult a -> a # elem :: Eq a => a -> IResult a -> Bool # maximum :: Ord a => IResult a -> a # minimum :: Ord a => IResult a -> a # | |
Traversable IResult | |
Alternative IResult | |
Applicative IResult | |
Functor IResult | |
Monad IResult | |
MonadPlus IResult | |
Monoid (IResult a) | |
Semigroup (IResult a) | |
Show a => Show (IResult a) | |
NFData a => NFData (IResult a) | |
Defined in Data.Aeson.Types.Internal | |
Eq a => Eq (IResult a) | |
defaultRules :: [Rule] Source #
idecodeStrict :: FromJSON a => ByteString -> IResult a Source #
data ModifiedWhileReading Source #
Instances
Exception ModifiedWhileReading Source # | |
Defined in Data.JSON.Directory | |
Show ModifiedWhileReading Source # | |
Defined in Data.JSON.Directory showsPrec :: Int -> ModifiedWhileReading -> ShowS # show :: ModifiedWhileReading -> String # showList :: [ModifiedWhileReading] -> ShowS # |
Instances
Exception NoRuleFor Source # | |
Defined in Data.JSON.Directory toException :: NoRuleFor -> SomeException # fromException :: SomeException -> Maybe NoRuleFor # displayException :: NoRuleFor -> String # | |
Show NoRuleFor Source # | |