factor out Utility.Aeson.textKey
This commit is contained in:
parent
a314a8dfd0
commit
cbd138e042
4 changed files with 17 additions and 36 deletions
12
Remote.hs
12
Remote.hs
|
@ -5,7 +5,7 @@
|
|||
- Licensed under the GNU AGPL version 3 or higher.
|
||||
-}
|
||||
|
||||
{-# LANGUAGE OverloadedStrings, CPP #-}
|
||||
{-# LANGUAGE OverloadedStrings #-}
|
||||
|
||||
module Remote (
|
||||
Remote,
|
||||
|
@ -63,9 +63,6 @@ module Remote (
|
|||
|
||||
import Data.Ord
|
||||
import Data.String
|
||||
#if MIN_VERSION_aeson(2,0,0)
|
||||
import qualified Data.Aeson.Key as AK
|
||||
#endif
|
||||
import qualified Data.Map as M
|
||||
import qualified Data.Vector as V
|
||||
|
||||
|
@ -247,12 +244,7 @@ prettyPrintUUIDsWith optfield header descm showval uuidvals = do
|
|||
, Just ("here", toJSON' $ hereu == u)
|
||||
, case (optfield, optval) of
|
||||
(Just field, Just val) -> Just
|
||||
(
|
||||
#if MIN_VERSION_aeson(2,0,0)
|
||||
AK.fromText $
|
||||
#endif
|
||||
packString field
|
||||
, toJSON' val)
|
||||
(textKey (packString field), toJSON' val)
|
||||
_ -> Nothing
|
||||
]
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue