- type ReduceSignature a = [Value] -> [Value] -> Bool -> ViewReduce a
- type ViewReduce a = ViewReduceT Parser a
- class Monad m => MonadParser m where
- parseJSON :: (MonadParser m, FromJSON a) => Value -> m a
- parseJSONList :: (MonadParser m, FromJSON a) => [Value] -> m [a]
- (.:) :: (MonadParser m, FromJSON a) => Object -> Text -> m a
- (.:?) :: (MonadParser m, FromJSON a) => Object -> Text -> m (Maybe a)
- (.=) :: ToJSON a => Text -> a -> Pair
- object :: [Pair] -> Value
- data Value
- logMsg :: String -> ViewReduce ()
The type of your reduce functions as they are stored in CouchDB. The trivial example:
\keys values rereduce -> return Null
The monad within which a reduce computation takes place. This is a
transformation of the
Parser monad, although the precise
nature and depth of the transformation is an internal detail and subject to
change. ViewReduceT is guaranteed to be an instance of the
class, allowing you to parse JSON structures.
JSON parsers lifted into our view monads. This also exports one or two
useful symbols from
Like MonadIO, but for
Parser. This allows JSON parsing
operations to be lifted into our various view monads.
Attempts to parse a JSON value into a given type. This is typically used with a type annotation to indicate the target type. If the value can not be parsed into that type, the entire computation will fail.
parseJSON to a list of values. This is commonly used with the
reduce function arguments.
Parses a required field of an object. If the field is not present, or the value can not be parsed into the target type, the computation will fail.
Parses an optional field of an object. This will not halt the computation on failure.
A JSON value represented as a Haskell value.