{-# OPTIONS_GHC -fno-warn-dodgy-exports -fno-warn-duplicate-exports #-}
module Autodocodec.Aeson
(
encodeJSONViaCodec,
eitherDecodeJSONViaCodec,
toJSONViaCodec,
toJSONVia,
toEncodingViaCodec,
toEncodingVia,
toJSONObjectViaCodec,
toJSONObjectVia,
toSeriesViaCodec,
toSeriesVia,
parseJSONViaCodec,
parseJSONVia,
parseJSONObjectViaCodec,
parseJSONObjectVia,
module Autodocodec.Aeson.Decode,
module Autodocodec.Aeson.Encode,
)
where
import Autodocodec.Aeson.Decode
import Autodocodec.Aeson.Encode
import Autodocodec.Class
import Autodocodec.DerivingVia
import qualified Data.Aeson as Aeson
import qualified Data.ByteString.Lazy as LB
encodeJSONViaCodec :: HasCodec a => a -> LB.ByteString
encodeJSONViaCodec :: forall a. HasCodec a => a -> ByteString
encodeJSONViaCodec = forall a. ToJSON a => a -> ByteString
Aeson.encode forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. a -> Autodocodec a
Autodocodec
eitherDecodeJSONViaCodec :: HasCodec a => LB.ByteString -> Either String a
eitherDecodeJSONViaCodec :: forall a. HasCodec a => ByteString -> Either String a
eitherDecodeJSONViaCodec = forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap forall a. Autodocodec a -> a
unAutodocodec forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. FromJSON a => ByteString -> Either String a
Aeson.eitherDecode