@@ -44,7 +44,7 @@ data TextConstraint
44 deriving (Generic)
44 deriving (Generic)
46instance SingKind TextConstraint where
46instance SingKind TextConstraint where
47− type DemoteRep TextConstraint = DemotedTextConstraint
47+ type Demote TextConstraint = DemotedTextConstraint
48 fromSing = \case
48 fromSing = \case
49 STEq n -> withKnownNat n (DTEq $ natVal n)
49 STEq n -> withKnownNat n (DTEq $ natVal n)
50 STLt n -> withKnownNat n (DTLt $ natVal n)
50 STLt n -> withKnownNat n (DTLt $ natVal n)
@@ -75,7 +75,7 @@ instance SingKind TextConstraint where
75 Nothing -> error "Negative singleton nat"
75 Nothing -> error "Negative singleton nat"
76 DTRegex s -> case someSymbolVal (T.unpack s) of
76 DTRegex s -> case someSymbolVal (T.unpack s) of
77 SomeSymbol (_ :: Proxy n) -> SomeSing (STRegex (SSym :: Sing n))
77 SomeSymbol (_ :: Proxy n) -> SomeSing (STRegex (SSym :: Sing n))
78− DTEnum ss -> case toSing (T.unpack <$> ss) of
78+ DTEnum ss -> case toSing ss of
79 SomeSing l -> SomeSing (STEnum l)
79 SomeSing l -> SomeSing (STEnum l)
81data DemotedTextConstraint
81data DemotedTextConstraint
@@ -149,7 +149,7 @@ instance Eq (Sing ('NGt n)) where _ == _ = True
149instance Eq (Sing ('NGe n)) where _ == _ = True
149instance Eq (Sing ('NGe n)) where _ == _ = True
151instance SingKind NumberConstraint where
151instance SingKind NumberConstraint where
152− type DemoteRep NumberConstraint = DemotedNumberConstraint
152+ type Demote NumberConstraint = DemotedNumberConstraint
153 fromSing = \case
153 fromSing = \case
154 SNEq n -> withKnownNat n (DNEq $ natVal n)
154 SNEq n -> withKnownNat n (DNEq $ natVal n)
155 SNGt n -> withKnownNat n (DNGt $ natVal n)
155 SNGt n -> withKnownNat n (DNGt $ natVal n)
@@ -189,7 +189,7 @@ instance KnownNat n => SingI ('AEq n) where sing = SAEq sing
189instance Eq (Sing ('AEq n)) where _ == _ = True
189instance Eq (Sing ('AEq n)) where _ == _ = True
191instance SingKind ArrayConstraint where
191instance SingKind ArrayConstraint where
192− type DemoteRep ArrayConstraint = DemotedArrayConstraint
192+ type Demote ArrayConstraint = DemotedArrayConstraint
193 fromSing = \case
193 fromSing = \case
194 SAEq n -> withKnownNat n (DAEq $ natVal n)
194 SAEq n -> withKnownNat n (DAEq $ natVal n)
195 toSing = \case
195 toSing = \case
@@ -250,7 +250,7 @@ instance Eq (Sing ('SchemaObject cs)) where _ == _ = True
250instance Eq (Sing ('SchemaOptional s)) where _ == _ = True
250instance Eq (Sing ('SchemaOptional s)) where _ == _ = True
252instance SingKind Schema where
252instance SingKind Schema where
253− type DemoteRep Schema = DemotedSchema
253+ type Demote Schema = DemotedSchema
254 fromSing = \case
254 fromSing = \case
255 SSchemaText cs -> DSchemaText $ fromSing cs
255 SSchemaText cs -> DSchemaText $ fromSing cs
256 SSchemaNumber cs -> DSchemaNumber $ fromSing cs
256 SSchemaNumber cs -> DSchemaNumber $ fromSing cs
@@ -275,7 +275,7 @@ instance SingKind Schema where
275 DSchemaOptional sch -> case toSing sch of
275 DSchemaOptional sch -> case toSing sch of
276 SomeSing ssch -> SomeSing $ SSchemaOptional ssch
276 SomeSing ssch -> SomeSing $ SSchemaOptional ssch
277 DSchemaNull -> SomeSing SSchemaNull
277 DSchemaNull -> SomeSing SSchemaNull
278− DSchemaObject cs -> case toSing ((\(sym,sch) -> (T.unpack sym, sch)) <$> cs) of
278+ DSchemaObject cs -> case toSing cs of
279 SomeSing scs -> SomeSing $ SSchemaObject scs
279 SomeSing scs -> SomeSing $ SSchemaObject scs
281data FieldRepr :: (Symbol, Schema) -> Type where
281data FieldRepr :: (Symbol, Schema) -> Type where