module Prelate (
module Incipit,
module Prelate.Atomic,
module Data.Aeson,
module Lens.Micro,
module Lens.Micro.Extras,
json,
unaryJson,
) where
import qualified Data.Aeson as Aeson
import Data.Aeson (FromJSON, ToJSON)
import Data.Aeson.TH (deriveJSON)
import Data.Generics.Labels ()
import Data.List (dropWhileEnd)
import Incipit
import qualified Language.Haskell.TH.Syntax as TH
import Lens.Micro
import Lens.Micro.Extras
import Prelate.Atomic
basicOptions :: Aeson.Options
basicOptions :: Options
basicOptions =
Options
Aeson.defaultOptions { fieldLabelModifier :: String -> String
Aeson.fieldLabelModifier = (Char -> Bool) -> String -> String
forall a. (a -> Bool) -> [a] -> [a]
dropWhileEnd (Char
'_' Char -> Char -> Bool
forall a. Eq a => a -> a -> Bool
==) (String -> String) -> (String -> String) -> String -> String
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Char -> Bool) -> String -> String
forall a. (a -> Bool) -> [a] -> [a]
dropWhile (Char
'_' Char -> Char -> Bool
forall a. Eq a => a -> a -> Bool
==) }
json :: TH.Name -> TH.Q [TH.Dec]
json :: Name -> Q [Dec]
json =
Options -> Name -> Q [Dec]
deriveJSON Options
basicOptions { unwrapUnaryRecords :: Bool
Aeson.unwrapUnaryRecords = Bool
True }
unaryJson :: TH.Name -> TH.Q [TH.Dec]
unaryJson :: Name -> Q [Dec]
unaryJson =
Options -> Name -> Q [Dec]
deriveJSON Options
basicOptions