on master help sign in
Add missing instances for ReprBoolean
1a2f425Nikita
src/Data/Schematic/Schema.hs+10−1
@@ -12,8 +12,8 @@ import Data.Aeson.Types as J
12import Data.HashMap.Strict as H
12import Data.HashMap.Strict as H
13import Data.Kind
13import Data.Kind
14import Data.Maybe
14import Data.Maybe
15−import Data.Schematic.Instances ()
16import Data.Schematic.Generator
15import Data.Schematic.Generator
16+import Data.Schematic.Instances ()
17import Data.Scientific
17import Data.Scientific
18import Data.Singletons.Prelude.List hiding (All, Union)
18import Data.Singletons.Prelude.List hiding (All, Union)
19import Data.Singletons.TH
19import Data.Singletons.TH
@@ -368,6 +368,9 @@ instance Show (JsonRepr ('SchemaText cs)) where
368instance Show (JsonRepr ('SchemaNumber cs)) where
368instance Show (JsonRepr ('SchemaNumber cs)) where
369 show (ReprNumber n) = "ReprNumber " P.++ show n
369 show (ReprNumber n) = "ReprNumber " P.++ show n
370
370
371+instance Show (JsonRepr 'SchemaBoolean) where
372+ show (ReprBoolean n) = "ReprBoolena " P.++ show n
373+
371instance Show (JsonRepr 'SchemaNull) where show _ = "ReprNull"
374instance Show (JsonRepr 'SchemaNull) where show _ = "ReprNull"
372
375
373instance Show (JsonRepr s) => Show (JsonRepr ('SchemaArray acs s)) where
376instance Show (JsonRepr s) => Show (JsonRepr ('SchemaArray acs s)) where
@@ -388,6 +391,9 @@ instance Eq (JsonRepr ('SchemaText cs)) where
388instance Eq (JsonRepr ('SchemaNumber cs)) where
391instance Eq (JsonRepr ('SchemaNumber cs)) where
389 ReprNumber a == ReprNumber b = a == b
392 ReprNumber a == ReprNumber b = a == b
390
393
394+instance Eq (JsonRepr 'SchemaBoolean) where
395+ ReprBoolean a == ReprBoolean b = a == b
396+
391instance Eq (JsonRepr 'SchemaNull) where
397instance Eq (JsonRepr 'SchemaNull) where
392 ReprNull == ReprNull = True
398 ReprNull == ReprNull = True
393
399
@@ -406,6 +412,9 @@ instance Ord (JsonRepr ('SchemaText cs)) where
406instance Ord (JsonRepr ('SchemaNumber cs)) where
412instance Ord (JsonRepr ('SchemaNumber cs)) where
407 ReprNumber a `compare` ReprNumber b = a `compare` b
413 ReprNumber a `compare` ReprNumber b = a `compare` b
408
414
415+instance Ord (JsonRepr 'SchemaBoolean) where
416+ ReprBoolean a `compare` ReprBoolean b = a `compare` b
417+
409instance Ord (JsonRepr 'SchemaNull) where
418instance Ord (JsonRepr 'SchemaNull) where
410 compare _ _ = EQ
419 compare _ _ = EQ
411
420