feat: PrettySerialize instances
This commit is contained in:
parent
cabfbf46ac
commit
55805ef15a
7 changed files with 21 additions and 3 deletions
|
@ -1,6 +1,8 @@
|
|||
{-# LANGUAGE OverloadedStrings #-}
|
||||
{-# LANGUAGE LambdaCase #-}
|
||||
{-# LANGUAGE TypeApplications #-}
|
||||
{-# LANGUAGE DerivingVia #-}
|
||||
{-# LANGUAGE DeriveGeneric #-}
|
||||
module Language.Json (Value(..), null, true, false, boolean, buildInteger, number, document) where
|
||||
import Data.Text (Text)
|
||||
import Data.Array.IArray (Array)
|
||||
|
@ -21,6 +23,8 @@ import qualified Data.Text.Internal.Read as Text
|
|||
import qualified Debug.Trace as Debug
|
||||
import qualified Data.Array.IArray as Array
|
||||
import qualified Data.Map.Strict as Map
|
||||
import GHC.Generics ( Generic, Generically(..) )
|
||||
import Pretty.Serialize (PrettySerialize)
|
||||
|
||||
|
||||
data Value
|
||||
|
@ -30,7 +34,8 @@ data Value
|
|||
| Number Rational
|
||||
| Array (Array Natural Value)
|
||||
| Object (Map Text Value)
|
||||
deriving Show
|
||||
deriving (Show, Generic)
|
||||
deriving PrettySerialize via Generically Value
|
||||
|
||||
null :: Parser Value
|
||||
null = do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue