    {-# LANGUAGE CPP                #-}
    {-# LANGUAGE DeriveDataTypeable #-}
    {-# LANGUAGE DeriveFoldable     #-}
    {-# LANGUAGE DeriveFunctor      #-}
    {-# LANGUAGE DeriveTraversable  #-}
    {-# LANGUAGE TypeFamilies       #-}
    {-# OPTIONS_GHC -fno-warn-orphans #-}
    -----------------------------------------------------------------------------
    -- |
    -- Module      :  Data.Aeson.Extra.Recursive
    -- Copyright   :  (C) 2015-2017 Oleg Grenrus
    -- License     :  BSD3
    -- Maintainer  :  Oleg Grenrus <oleg.grenrus@iki.fi>
    --
    -- Helps writing recursive algorithms on 'Value', for example:
    --
    -- @
    -- stripNulls :: Value -> Value
    -- stripNulls = 'cata' ('embed' . f)
    --  where
    --    f (ObjectF a) = ObjectF $ HM.filter (== Null) a
    --    f x = x
    -- @
    module Data.Aeson.Extra.Recursive (
        ValueF(..),
        ObjectF,
        ArrayF,
        ) where

    import Prelude ()
    import Prelude.Compat

    import Data.Aeson
    import Data.Data             (Data)
    import Data.Functor.Foldable
    import Data.HashMap.Strict   (HashMap)
    import Data.Scientific       (Scientific)
    import Data.Text             (Text)
    import Data.Typeable         (Typeable)
    import Data.Vector           (Vector)

    #if !(MIN_VERSION_recursion_schemes(5,0,0))
    #define Recursive F.Foldable
    #define Corecursive F.Unfoldable
    import qualified Data.Functor.Foldable as F
    #endif

    #if MIN_VERSION_aeson(2,0,0)
    import qualified Data.Aeson.KeyMap as KM
    #endif

    -- | A JSON \"object\" (key\/value map).
    --
    -- /Since: aeson-extra-0.3.1.0/
    type ObjectF a = HashMap Text a

    -- | A JSON \"array\" (sequence).
    --
    -- /Since: aeson-extra-0.3.1.0/
    type ArrayF a = Vector a

    -- | An algebra of 'Value'
    --
    -- /Since: aeson-extra-0.3.1.0/
    data ValueF a
        = ObjectF (ObjectF a)
        | ArrayF !(ArrayF a)
        | StringF !Text
        | NumberF !Scientific
        | BoolF !Bool
        | NullF
        deriving (ValueF a -> ValueF a -> Bool
    (ValueF a -> ValueF a -> Bool)
    -> (ValueF a -> ValueF a -> Bool) -> Eq (ValueF a)
    forall a. Eq a => ValueF a -> ValueF a -> Bool
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: forall a. Eq a => ValueF a -> ValueF a -> Bool
    == :: ValueF a -> ValueF a -> Bool
    $c/= :: forall a. Eq a => ValueF a -> ValueF a -> Bool
    /= :: ValueF a -> ValueF a -> Bool
    Eq, ReadPrec [ValueF a]
    ReadPrec (ValueF a)
    Int -> ReadS (ValueF a)
    ReadS [ValueF a]
    (Int -> ReadS (ValueF a))
    -> ReadS [ValueF a]
    -> ReadPrec (ValueF a)
    -> ReadPrec [ValueF a]
    -> Read (ValueF a)
    forall a. Read a => ReadPrec [ValueF a]
    forall a. Read a => ReadPrec (ValueF a)
    forall a. Read a => Int -> ReadS (ValueF a)
    forall a. Read a => ReadS [ValueF a]
    forall a.
    (Int -> ReadS a)
    -> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
    $creadsPrec :: forall a. Read a => Int -> ReadS (ValueF a)
    readsPrec :: Int -> ReadS (ValueF a)
    $creadList :: forall a. Read a => ReadS [ValueF a]
    readList :: ReadS [ValueF a]
    $creadPrec :: forall a. Read a => ReadPrec (ValueF a)
    readPrec :: ReadPrec (ValueF a)
    $creadListPrec :: forall a. Read a => ReadPrec [ValueF a]
    readListPrec :: ReadPrec [ValueF a]
    Read, Int -> ValueF a -> ShowS
    [ValueF a] -> ShowS
    ValueF a -> String
    (Int -> ValueF a -> ShowS)
    -> (ValueF a -> String) -> ([ValueF a] -> ShowS) -> Show (ValueF a)
    forall a. Show a => Int -> ValueF a -> ShowS
    forall a. Show a => [ValueF a] -> ShowS
    forall a. Show a => ValueF a -> String
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: forall a. Show a => Int -> ValueF a -> ShowS
    showsPrec :: Int -> ValueF a -> ShowS
    $cshow :: forall a. Show a => ValueF a -> String
    show :: ValueF a -> String
    $cshowList :: forall a. Show a => [ValueF a] -> ShowS
    showList :: [ValueF a] -> ShowS
    Show, Typeable, Typeable (ValueF a)
    Typeable (ValueF a)
    -> (forall (c :: * -> *).
        (forall d b. Data d => c (d -> b) -> d -> c b)
        -> (forall g. g -> c g) -> ValueF a -> c (ValueF a))
    -> (forall (c :: * -> *).
        (forall b r. Data b => c (b -> r) -> c r)
        -> (forall r. r -> c r) -> Constr -> c (ValueF a))
    -> (ValueF a -> Constr)
    -> (ValueF a -> DataType)
    -> (forall (t :: * -> *) (c :: * -> *).
        Typeable t =>
        (forall d. Data d => c (t d)) -> Maybe (c (ValueF a)))
    -> (forall (t :: * -> * -> *) (c :: * -> *).
        Typeable t =>
        (forall d e. (Data d, Data e) => c (t d e))
        -> Maybe (c (ValueF a)))
    -> ((forall b. Data b => b -> b) -> ValueF a -> ValueF a)
    -> (forall r r'.
        (r -> r' -> r)
        -> r -> (forall d. Data d => d -> r') -> ValueF a -> r)
    -> (forall r r'.
        (r' -> r -> r)
        -> r -> (forall d. Data d => d -> r') -> ValueF a -> r)
    -> (forall u. (forall d. Data d => d -> u) -> ValueF a -> [u])
    -> (forall u. Int -> (forall d. Data d => d -> u) -> ValueF a -> u)
    -> (forall (m :: * -> *).
        Monad m =>
        (forall d. Data d => d -> m d) -> ValueF a -> m (ValueF a))
    -> (forall (m :: * -> *).
        MonadPlus m =>
        (forall d. Data d => d -> m d) -> ValueF a -> m (ValueF a))
    -> (forall (m :: * -> *).
        MonadPlus m =>
        (forall d. Data d => d -> m d) -> ValueF a -> m (ValueF a))
    -> Data (ValueF a)
    ValueF a -> Constr
    ValueF a -> DataType
    (forall b. Data b => b -> b) -> ValueF a -> ValueF a
    forall {a}. Data a => Typeable (ValueF a)
    forall a. Data a => ValueF a -> Constr
    forall a. Data a => ValueF a -> DataType
    forall a.
    Data a =>
    (forall b. Data b => b -> b) -> ValueF a -> ValueF a
    forall a u.
    Data a =>
    Int -> (forall d. Data d => d -> u) -> ValueF a -> u
    forall a u.
    Data a =>
    (forall d. Data d => d -> u) -> ValueF a -> [u]
    forall a r r'.
    Data a =>
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> ValueF a -> r
    forall a r r'.
    Data a =>
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> ValueF a -> r
    forall a (m :: * -> *).
    (Data a, Monad m) =>
    (forall d. Data d => d -> m d) -> ValueF a -> m (ValueF a)
    forall a (m :: * -> *).
    (Data a, MonadPlus m) =>
    (forall d. Data d => d -> m d) -> ValueF a -> m (ValueF a)
    forall a (c :: * -> *).
    Data a =>
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c (ValueF a)
    forall a (c :: * -> *).
    Data a =>
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> ValueF a -> c (ValueF a)
    forall a (t :: * -> *) (c :: * -> *).
    (Data a, Typeable t) =>
    (forall d. Data d => c (t d)) -> Maybe (c (ValueF a))
    forall a (t :: * -> * -> *) (c :: * -> *).
    (Data a, Typeable t) =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (ValueF a))
    forall a.
    Typeable a
    -> (forall (c :: * -> *).
        (forall d b. Data d => c (d -> b) -> d -> c b)
        -> (forall g. g -> c g) -> a -> c a)
    -> (forall (c :: * -> *).
        (forall b r. Data b => c (b -> r) -> c r)
        -> (forall r. r -> c r) -> Constr -> c a)
    -> (a -> Constr)
    -> (a -> DataType)
    -> (forall (t :: * -> *) (c :: * -> *).
        Typeable t =>
        (forall d. Data d => c (t d)) -> Maybe (c a))
    -> (forall (t :: * -> * -> *) (c :: * -> *).
        Typeable t =>
        (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
    -> ((forall b. Data b => b -> b) -> a -> a)
    -> (forall r r'.
        (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
    -> (forall r r'.
        (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
    -> (forall u. (forall d. Data d => d -> u) -> a -> [u])
    -> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
    -> (forall (m :: * -> *).
        Monad m =>
        (forall d. Data d => d -> m d) -> a -> m a)
    -> (forall (m :: * -> *).
        MonadPlus m =>
        (forall d. Data d => d -> m d) -> a -> m a)
    -> (forall (m :: * -> *).
        MonadPlus m =>
        (forall d. Data d => d -> m d) -> a -> m a)
    -> Data a
    forall u. Int -> (forall d. Data d => d -> u) -> ValueF a -> u
    forall u. (forall d. Data d => d -> u) -> ValueF a -> [u]
    forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> ValueF a -> r
    forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> ValueF a -> r
    forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> ValueF a -> m (ValueF a)
    forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> ValueF a -> m (ValueF a)
    forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c (ValueF a)
    forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> ValueF a -> c (ValueF a)
    forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c (ValueF a))
    forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (ValueF a))
    $cgfoldl :: forall a (c :: * -> *).
    Data a =>
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> ValueF a -> c (ValueF a)
    gfoldl :: forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> ValueF a -> c (ValueF a)
    $cgunfold :: forall a (c :: * -> *).
    Data a =>
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c (ValueF a)
    gunfold :: forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c (ValueF a)
    $ctoConstr :: forall a. Data a => ValueF a -> Constr
    toConstr :: ValueF a -> Constr
    $cdataTypeOf :: forall a. Data a => ValueF a -> DataType
    dataTypeOf :: ValueF a -> DataType
    $cdataCast1 :: forall a (t :: * -> *) (c :: * -> *).
    (Data a, Typeable t) =>
    (forall d. Data d => c (t d)) -> Maybe (c (ValueF a))
    dataCast1 :: forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c (ValueF a))
    $cdataCast2 :: forall a (t :: * -> * -> *) (c :: * -> *).
    (Data a, Typeable t) =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (ValueF a))
    dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (ValueF a))
    $cgmapT :: forall a.
    Data a =>
    (forall b. Data b => b -> b) -> ValueF a -> ValueF a
    gmapT :: (forall b. Data b => b -> b) -> ValueF a -> ValueF a
    $cgmapQl :: forall a r r'.
    Data a =>
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> ValueF a -> r
    gmapQl :: forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> ValueF a -> r
    $cgmapQr :: forall a r r'.
    Data a =>
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> ValueF a -> r
    gmapQr :: forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> ValueF a -> r
    $cgmapQ :: forall a u.
    Data a =>
    (forall d. Data d => d -> u) -> ValueF a -> [u]
    gmapQ :: forall u. (forall d. Data d => d -> u) -> ValueF a -> [u]
    $cgmapQi :: forall a u.
    Data a =>
    Int -> (forall d. Data d => d -> u) -> ValueF a -> u
    gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> ValueF a -> u
    $cgmapM :: forall a (m :: * -> *).
    (Data a, Monad m) =>
    (forall d. Data d => d -> m d) -> ValueF a -> m (ValueF a)
    gmapM :: forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> ValueF a -> m (ValueF a)
    $cgmapMp :: forall a (m :: * -> *).
    (Data a, MonadPlus m) =>
    (forall d. Data d => d -> m d) -> ValueF a -> m (ValueF a)
    gmapMp :: forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> ValueF a -> m (ValueF a)
    $cgmapMo :: forall a (m :: * -> *).
    (Data a, MonadPlus m) =>
    (forall d. Data d => d -> m d) -> ValueF a -> m (ValueF a)
    gmapMo :: forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> ValueF a -> m (ValueF a)
    Data, (forall a b. (a -> b) -> ValueF a -> ValueF b)
    -> (forall a b. a -> ValueF b -> ValueF a) -> Functor ValueF
    forall a b. a -> ValueF b -> ValueF a
    forall a b. (a -> b) -> ValueF a -> ValueF b
    forall (f :: * -> *).
    (forall a b. (a -> b) -> f a -> f b)
    -> (forall a b. a -> f b -> f a) -> Functor f
    $cfmap :: forall a b. (a -> b) -> ValueF a -> ValueF b
    fmap :: forall a b. (a -> b) -> ValueF a -> ValueF b
    $c<$ :: forall a b. a -> ValueF b -> ValueF a
    <$ :: forall a b. a -> ValueF b -> ValueF a
    Functor, (forall m. Monoid m => ValueF m -> m)
    -> (forall m a. Monoid m => (a -> m) -> ValueF a -> m)
    -> (forall m a. Monoid m => (a -> m) -> ValueF a -> m)
    -> (forall a b. (a -> b -> b) -> b -> ValueF a -> b)
    -> (forall a b. (a -> b -> b) -> b -> ValueF a -> b)
    -> (forall b a. (b -> a -> b) -> b -> ValueF a -> b)
    -> (forall b a. (b -> a -> b) -> b -> ValueF a -> b)
    -> (forall a. (a -> a -> a) -> ValueF a -> a)
    -> (forall a. (a -> a -> a) -> ValueF a -> a)
    -> (forall a. ValueF a -> [a])
    -> (forall a. ValueF a -> Bool)
    -> (forall a. ValueF a -> Int)
    -> (forall a. Eq a => a -> ValueF a -> Bool)
    -> (forall a. Ord a => ValueF a -> a)
    -> (forall a. Ord a => ValueF a -> a)
    -> (forall a. Num a => ValueF a -> a)
    -> (forall a. Num a => ValueF a -> a)
    -> Foldable ValueF
    forall a. Eq a => a -> ValueF a -> Bool
    forall a. Num a => ValueF a -> a
    forall a. Ord a => ValueF a -> a
    forall m. Monoid m => ValueF m -> m
    forall a. ValueF a -> Bool
    forall a. ValueF a -> Int
    forall a. ValueF a -> [a]
    forall a. (a -> a -> a) -> ValueF a -> a
    forall m a. Monoid m => (a -> m) -> ValueF a -> m
    forall b a. (b -> a -> b) -> b -> ValueF a -> b
    forall a b. (a -> b -> b) -> b -> ValueF a -> b
    forall (t :: * -> *).
    (forall m. Monoid m => t m -> m)
    -> (forall m a. Monoid m => (a -> m) -> t a -> m)
    -> (forall m a. Monoid m => (a -> m) -> t a -> m)
    -> (forall a b. (a -> b -> b) -> b -> t a -> b)
    -> (forall a b. (a -> b -> b) -> b -> t a -> b)
    -> (forall b a. (b -> a -> b) -> b -> t a -> b)
    -> (forall b a. (b -> a -> b) -> b -> t a -> b)
    -> (forall a. (a -> a -> a) -> t a -> a)
    -> (forall a. (a -> a -> a) -> t a -> a)
    -> (forall a. t a -> [a])
    -> (forall a. t a -> Bool)
    -> (forall a. t a -> Int)
    -> (forall a. Eq a => a -> t a -> Bool)
    -> (forall a. Ord a => t a -> a)
    -> (forall a. Ord a => t a -> a)
    -> (forall a. Num a => t a -> a)
    -> (forall a. Num a => t a -> a)
    -> Foldable t
    $cfold :: forall m. Monoid m => ValueF m -> m
    fold :: forall m. Monoid m => ValueF m -> m
    $cfoldMap :: forall m a. Monoid m => (a -> m) -> ValueF a -> m
    foldMap :: forall m a. Monoid m => (a -> m) -> ValueF a -> m
    $cfoldMap' :: forall m a. Monoid m => (a -> m) -> ValueF a -> m
    foldMap' :: forall m a. Monoid m => (a -> m) -> ValueF a -> m
    $cfoldr :: forall a b. (a -> b -> b) -> b -> ValueF a -> b
    foldr :: forall a b. (a -> b -> b) -> b -> ValueF a -> b
    $cfoldr' :: forall a b. (a -> b -> b) -> b -> ValueF a -> b
    foldr' :: forall a b. (a -> b -> b) -> b -> ValueF a -> b
    $cfoldl :: forall b a. (b -> a -> b) -> b -> ValueF a -> b
    foldl :: forall b a. (b -> a -> b) -> b -> ValueF a -> b
    $cfoldl' :: forall b a. (b -> a -> b) -> b -> ValueF a -> b
    foldl' :: forall b a. (b -> a -> b) -> b -> ValueF a -> b
    $cfoldr1 :: forall a. (a -> a -> a) -> ValueF a -> a
    foldr1 :: forall a. (a -> a -> a) -> ValueF a -> a
    $cfoldl1 :: forall a. (a -> a -> a) -> ValueF a -> a
    foldl1 :: forall a. (a -> a -> a) -> ValueF a -> a
    $ctoList :: forall a. ValueF a -> [a]
    toList :: forall a. ValueF a -> [a]
    $cnull :: forall a. ValueF a -> Bool
    null :: forall a. ValueF a -> Bool
    $clength :: forall a. ValueF a -> Int
    length :: forall a. ValueF a -> Int
    $celem :: forall a. Eq a => a -> ValueF a -> Bool
    elem :: forall a. Eq a => a -> ValueF a -> Bool
    $cmaximum :: forall a. Ord a => ValueF a -> a
    maximum :: forall a. Ord a => ValueF a -> a
    $cminimum :: forall a. Ord a => ValueF a -> a
    minimum :: forall a. Ord a => ValueF a -> a
    $csum :: forall a. Num a => ValueF a -> a
    sum :: forall a. Num a => ValueF a -> a
    $cproduct :: forall a. Num a => ValueF a -> a
    product :: forall a. Num a => ValueF a -> a
    Prelude.Compat.Foldable, Functor ValueF
    Foldable ValueF
    Functor ValueF
    -> Foldable ValueF
    -> (forall (f :: * -> *) a b.
        Applicative f =>
        (a -> f b) -> ValueF a -> f (ValueF b))
    -> (forall (f :: * -> *) a.
        Applicative f =>
        ValueF (f a) -> f (ValueF a))
    -> (forall (m :: * -> *) a b.
        Monad m =>
        (a -> m b) -> ValueF a -> m (ValueF b))
    -> (forall (m :: * -> *) a.
        Monad m =>
        ValueF (m a) -> m (ValueF a))
    -> Traversable ValueF
    forall (t :: * -> *).
    Functor t
    -> Foldable t
    -> (forall (f :: * -> *) a b.
        Applicative f =>
        (a -> f b) -> t a -> f (t b))
    -> (forall (f :: * -> *) a. Applicative f => t (f a) -> f (t a))
    -> (forall (m :: * -> *) a b.
        Monad m =>
        (a -> m b) -> t a -> m (t b))
    -> (forall (m :: * -> *) a. Monad m => t (m a) -> m (t a))
    -> Traversable t
    forall (m :: * -> *) a. Monad m => ValueF (m a) -> m (ValueF a)
    forall (f :: * -> *) a.
    Applicative f =>
    ValueF (f a) -> f (ValueF a)
    forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> ValueF a -> m (ValueF b)
    forall (f :: * -> *) a b.
    Applicative f =>
    (a -> f b) -> ValueF a -> f (ValueF b)
    $ctraverse :: forall (f :: * -> *) a b.
    Applicative f =>
    (a -> f b) -> ValueF a -> f (ValueF b)
    traverse :: forall (f :: * -> *) a b.
    Applicative f =>
    (a -> f b) -> ValueF a -> f (ValueF b)
    $csequenceA :: forall (f :: * -> *) a.
    Applicative f =>
    ValueF (f a) -> f (ValueF a)
    sequenceA :: forall (f :: * -> *) a.
    Applicative f =>
    ValueF (f a) -> f (ValueF a)
    $cmapM :: forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> ValueF a -> m (ValueF b)
    mapM :: forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> ValueF a -> m (ValueF b)
    $csequence :: forall (m :: * -> *) a. Monad m => ValueF (m a) -> m (ValueF a)
    sequence :: forall (m :: * -> *) a. Monad m => ValueF (m a) -> m (ValueF a)
    Traversable)

    type instance Base Value = ValueF

    instance Recursive Value where
    #if MIN_VERSION_aeson(2,0,0)
        project :: Value -> Base Value Value
    project (Object Object
    o) = ObjectF Value -> ValueF Value
    forall a. ObjectF a -> ValueF a
    ObjectF (Object -> ObjectF Value
    forall v. KeyMap v -> HashMap Text v
    KM.toHashMapText Object
    o)
    #else
        project (Object o) = ObjectF o
    #endif
        project (Array Array
    a)  = Array -> ValueF Value
    forall a. ArrayF a -> ValueF a
    ArrayF Array
    a
        project (String Text
    s) = Text -> ValueF Value
    forall a. Text -> ValueF a
    StringF Text
    s
        project (Number Scientific
    n) = Scientific -> ValueF Value
    forall a. Scientific -> ValueF a
    NumberF Scientific
    n
        project (Bool Bool
    b)   = Bool -> ValueF Value
    forall a. Bool -> ValueF a
    BoolF Bool
    b
        project Value
    Null       = Base Value Value
    ValueF Value
    forall a. ValueF a
    NullF

    instance Corecursive Value where
    #if MIN_VERSION_aeson(2,0,0)
        embed :: Base Value Value -> Value
    embed (ObjectF ObjectF Value
    o) = Object -> Value
    Object (ObjectF Value -> Object
    forall v. HashMap Text v -> KeyMap v
    KM.fromHashMapText ObjectF Value
    o)
    #else
        embed (ObjectF o) = Object o
    #endif
        embed (ArrayF Array
    a)  = Array -> Value
    Array Array
    a
        embed (StringF Text
    s) = Text -> Value
    String Text
    s
        embed (NumberF Scientific
    n) = Scientific -> Value
    Number Scientific
    n
        embed (BoolF Bool
    b)   = Bool -> Value
    Bool Bool
    b
        embed Base Value Value
    ValueF Value
    NullF       = Value
    Null