@@ -331,20 +331,9 @@ data JsonRepr :: Schema -> Type where
331 ReprArray :: V.Vector (JsonRepr s) -> JsonRepr ('SchemaArray cs s)
331 ReprArray :: V.Vector (JsonRepr s) -> JsonRepr ('SchemaArray cs s)
332 ReprObject :: Rec FieldRepr fs -> JsonRepr ('SchemaObject fs)
332 ReprObject :: Rec FieldRepr fs -> JsonRepr ('SchemaObject fs)
333 ReprOptional :: Maybe (JsonRepr s) -> JsonRepr ('SchemaOptional s)
333 ReprOptional :: Maybe (JsonRepr s) -> JsonRepr ('SchemaOptional s)
335− -- :: USubsets (h ': tl)
336− :: Union JsonRepr (h ': tl)
337− -> JsonRepr ('SchemaUnion (h ': tl))
334+ ReprUnion :: Union JsonRepr (h ': tl) -> JsonRepr ('SchemaUnion (h ': tl))
339-- | Move to the union package
336-- | Move to the union package
340−type family UnionAll (f :: u -> *) (rs :: [u]) (c :: * -> Constraint) :: Constraint where
341− UnionAll f '[] c = ()
342− UnionAll f (r ': rs) c = (c (f r), UnionAll f rs c)
344−-- instance (UnionAll f as Show) => Show (Union f as) where
345−-- show (This fa) = "This " P.++ show fa
346−-- show (That u) = "That " P.++ show u
348instance Show (JsonRepr ('SchemaText cs)) where
337instance Show (JsonRepr ('SchemaText cs)) where
349 show (ReprText t) = "ReprText " P.++ show t
338 show (ReprText t) = "ReprText " P.++ show t
@@ -362,8 +351,6 @@ instance V.RecAll FieldRepr fs Show => Show (JsonRepr ('SchemaObject fs)) where
362instance Show (JsonRepr s) => Show (JsonRepr ('SchemaOptional s)) where
351instance Show (JsonRepr s) => Show (JsonRepr ('SchemaOptional s)) where
363 show (ReprOptional s) = "ReprOptional " P.++ show s
352 show (ReprOptional s) = "ReprOptional " P.++ show s
365−deriving instance UnionAll f as Show => Show (Union f as)
367instance (Monad m, Serial m Text)
354instance (Monad m, Serial m Text)
368 => Serial m (JsonRepr ('SchemaText cs)) where
355 => Serial m (JsonRepr ('SchemaText cs)) where
369 series = cons1 ReprText
356 series = cons1 ReprText