11{-# LANGUAGE AllowAmbiguousTypes #-}
2- {-# LANGUAGE OverloadedLists #-}
3- {-# LANGUAGE OverloadedStrings #-}
2+ {-# LANGUAGE CPP #-}
3+ {-# LANGUAGE OverloadedLists #-}
4+ {-# LANGUAGE OverloadedStrings #-}
45{-# OPTIONS_GHC -fprint-explicit-kinds #-}
56
67module Data.Schematic.Schema where
@@ -12,8 +13,8 @@ import Data.Aeson.Types as J
1213import Data.HashMap.Strict as H
1314import Data.Kind
1415import Data.Maybe
15- import Data.Schematic.Instances ()
1616import Data.Schematic.Generator
17+ import Data.Schematic.Instances ()
1718import Data.Scientific
1819import Data.Singletons.Prelude.List hiding (All , Union )
1920import Data.Singletons.TH
@@ -373,8 +374,16 @@ instance Show (JsonRepr 'SchemaNull) where show _ = "ReprNull"
373374instance Show (JsonRepr s ) => Show (JsonRepr ('SchemaArray acs s )) where
374375 show (ReprArray v) = " ReprArray " P. ++ show v
375376
377+ #if MIN_VERSION_base(4,12,0)
378+ instance
379+ ( V. RecAll FieldRepr fs Show , RMap fs , ReifyConstraint Show FieldRepr fs
380+ , RecordToList fs )
381+ => Show (JsonRepr ('SchemaObject fs )) where
382+ show (ReprObject fs) = " ReprObject " P. ++ show fs
383+ #else
376384instance V. RecAll FieldRepr fs Show => Show (JsonRepr ('SchemaObject fs )) where
377385 show (ReprObject fs) = " ReprObject " P. ++ show fs
386+ #endif
378387
379388instance Show (JsonRepr s ) => Show (JsonRepr ('SchemaOptional s )) where
380389 show (ReprOptional s) = " ReprOptional " P. ++ show s
0 commit comments