{-# LANGUAGE CPP #-}
module Data.Aeson.Compat
(
Key
, fromText
, toText
, KeyMap
, empty
, null
, singleton
, fromList
, toList
, unionWith
, Pair
, Value (Object)
, Object
, object
, (.=)
) where
import Data.Aeson.Types (Object, Pair, Value (Object), object, (.=))
#if MIN_VERSION_aeson(2, 0, 0)
import Data.Aeson.Key (Key, fromText, toText)
import Data.Aeson.KeyMap (KeyMap, empty, fromList, null, singleton, toList, unionWith)
import Data.HashMap.Strict ()
#else
import Prelude (id)
import Data.HashMap.Strict (HashMap, empty, fromList, null, singleton, toList, unionWith)
import Data.Text (Text)
type Key = Text
type KeyMap = HashMap Text
fromText :: Text -> Key
fromText = id
toText :: Key -> Text
toText = id
#endif