Version bump for #1241
This commit is contained in:
parent
18cd7834d6
commit
85e7fd7e33
@ -1,3 +1,7 @@
|
|||||||
|
## 1.4.21
|
||||||
|
|
||||||
|
* Add support for `Encoding` from `aeson-0.11` [#1241](https://github.com/yesodweb/yesod/pull/1241)
|
||||||
|
|
||||||
## 1.4.20.2
|
## 1.4.20.2
|
||||||
|
|
||||||
* GHC 8 support
|
* GHC 8 support
|
||||||
|
|||||||
@ -58,7 +58,7 @@ import Control.Monad (liftM)
|
|||||||
-- data, using the default layout for the HTML output
|
-- data, using the default layout for the HTML output
|
||||||
-- ('defaultLayout').
|
-- ('defaultLayout').
|
||||||
--
|
--
|
||||||
-- /Since: 0.3.0/
|
-- @since 0.3.0
|
||||||
defaultLayoutJson :: (Yesod site, J.ToJSON a)
|
defaultLayoutJson :: (Yesod site, J.ToJSON a)
|
||||||
=> WidgetT site IO () -- ^ HTML
|
=> WidgetT site IO () -- ^ HTML
|
||||||
-> HandlerT site IO a -- ^ JSON
|
-> HandlerT site IO a -- ^ JSON
|
||||||
@ -74,21 +74,21 @@ defaultLayoutJson w json = selectRep $ do
|
|||||||
-- | Wraps a data type in a 'RepJson'. The data type must
|
-- | Wraps a data type in a 'RepJson'. The data type must
|
||||||
-- support conversion to JSON via 'J.ToJSON'.
|
-- support conversion to JSON via 'J.ToJSON'.
|
||||||
--
|
--
|
||||||
-- /Since: 0.3.0/
|
-- @since 0.3.0
|
||||||
jsonToRepJson :: (Monad m, J.ToJSON a) => a -> m J.Value
|
jsonToRepJson :: (Monad m, J.ToJSON a) => a -> m J.Value
|
||||||
jsonToRepJson = return . J.toJSON
|
jsonToRepJson = return . J.toJSON
|
||||||
{-# DEPRECATED jsonToRepJson "Use returnJson instead" #-}
|
{-# DEPRECATED jsonToRepJson "Use returnJson instead" #-}
|
||||||
|
|
||||||
-- | Convert a value to a JSON representation via aeson\'s 'J.toJSON' function.
|
-- | Convert a value to a JSON representation via aeson\'s 'J.toJSON' function.
|
||||||
--
|
--
|
||||||
-- Since 1.2.1
|
-- @since 1.2.1
|
||||||
returnJson :: (Monad m, J.ToJSON a) => a -> m J.Value
|
returnJson :: (Monad m, J.ToJSON a) => a -> m J.Value
|
||||||
returnJson = return . J.toJSON
|
returnJson = return . J.toJSON
|
||||||
|
|
||||||
#if MIN_VERSION_aeson(0, 11, 0)
|
#if MIN_VERSION_aeson(0, 11, 0)
|
||||||
-- | Convert a value to a JSON representation via aeson\'s 'J.toEncoding' function.
|
-- | Convert a value to a JSON representation via aeson\'s 'J.toEncoding' function.
|
||||||
--
|
--
|
||||||
-- Since ?
|
-- @since 1.4.21
|
||||||
returnJsonEncoding :: (Monad m, J.ToJSON a) => a -> m J.Encoding
|
returnJsonEncoding :: (Monad m, J.ToJSON a) => a -> m J.Encoding
|
||||||
returnJsonEncoding = return . J.toEncoding
|
returnJsonEncoding = return . J.toEncoding
|
||||||
#endif
|
#endif
|
||||||
@ -96,7 +96,7 @@ returnJsonEncoding = return . J.toEncoding
|
|||||||
-- | Provide a JSON representation for usage with 'selectReps', using aeson\'s
|
-- | Provide a JSON representation for usage with 'selectReps', using aeson\'s
|
||||||
-- 'J.toJSON' (aeson >= 0.11: 'J.toEncoding') function to perform the conversion.
|
-- 'J.toJSON' (aeson >= 0.11: 'J.toEncoding') function to perform the conversion.
|
||||||
--
|
--
|
||||||
-- Since 1.2.1
|
-- @since 1.2.1
|
||||||
provideJson :: (Monad m, J.ToJSON a) => a -> Writer (Endo [ProvidedRep m]) ()
|
provideJson :: (Monad m, J.ToJSON a) => a -> Writer (Endo [ProvidedRep m]) ()
|
||||||
#if MIN_VERSION_aeson(0, 11, 0)
|
#if MIN_VERSION_aeson(0, 11, 0)
|
||||||
provideJson = provideRep . return . J.toEncoding
|
provideJson = provideRep . return . J.toEncoding
|
||||||
@ -113,7 +113,7 @@ provideJson = provideRep . return . J.toJSON
|
|||||||
-- twice will result in a parse error on the second call, since the request
|
-- twice will result in a parse error on the second call, since the request
|
||||||
-- body will no longer be available.
|
-- body will no longer be available.
|
||||||
--
|
--
|
||||||
-- /Since: 0.3.0/
|
-- @since 0.3.0
|
||||||
parseJsonBody :: (MonadHandler m, J.FromJSON a) => m (J.Result a)
|
parseJsonBody :: (MonadHandler m, J.FromJSON a) => m (J.Result a)
|
||||||
parseJsonBody = do
|
parseJsonBody = do
|
||||||
eValue <- rawRequestBody $$ runCatchC (sinkParser JP.value')
|
eValue <- rawRequestBody $$ runCatchC (sinkParser JP.value')
|
||||||
@ -161,7 +161,7 @@ jsonOrRedirect = jsonOrRedirect' J.toJSON
|
|||||||
-- @application\/json@ (e.g. AJAX, see 'acceptsJSON').
|
-- @application\/json@ (e.g. AJAX, see 'acceptsJSON').
|
||||||
--
|
--
|
||||||
-- 2. 3xx otherwise, following the PRG pattern.
|
-- 2. 3xx otherwise, following the PRG pattern.
|
||||||
-- Since ?
|
-- @since 1.4.21
|
||||||
jsonEncodingOrRedirect :: (MonadHandler m, J.ToJSON a)
|
jsonEncodingOrRedirect :: (MonadHandler m, J.ToJSON a)
|
||||||
=> Route (HandlerSite m) -- ^ Redirect target
|
=> Route (HandlerSite m) -- ^ Redirect target
|
||||||
-> a -- ^ Data to send via JSON
|
-> a -- ^ Data to send via JSON
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
name: yesod-core
|
name: yesod-core
|
||||||
version: 1.4.20.2
|
version: 1.4.21
|
||||||
license: MIT
|
license: MIT
|
||||||
license-file: LICENSE
|
license-file: LICENSE
|
||||||
author: Michael Snoyman <michael@snoyman.com>
|
author: Michael Snoyman <michael@snoyman.com>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user