@@ -38,49 +38,65 @@ type family CRepr (s :: Schema) :: Type where
39data TextConstraint
39data TextConstraint
43 | TRegex Symbol
45 | TRegex Symbol
44 | TEnum [Symbol]
46 | TEnum [Symbol]
45 deriving (Generic)
47 deriving (Generic)
47data instance Sing (tc :: TextConstraint) where
49data instance Sing (tc :: TextConstraint) where
48 STEq :: Sing n -> Sing ('TEq n)
50 STEq :: Sing n -> Sing ('TEq n)
51+ STLt :: Sing n -> Sing ('TLt n)
49 STLe :: Sing n -> Sing ('TLe n)
52 STLe :: Sing n -> Sing ('TLe n)
50 STGt :: Sing n -> Sing ('TGt n)
53 STGt :: Sing n -> Sing ('TGt n)
54+ STGe :: Sing n -> Sing ('TGe n)
51 STRegex :: Sing s -> Sing ('TRegex s)
55 STRegex :: Sing s -> Sing ('TRegex s)
52 STEnum :: All KnownSymbol ss => Sing ss -> Sing ('TEnum ss)
56 STEnum :: All KnownSymbol ss => Sing ss -> Sing ('TEnum ss)
54instance (KnownNat n) => SingI ('TEq n) where sing = STEq sing
58instance (KnownNat n) => SingI ('TEq n) where sing = STEq sing
55instance (KnownNat n) => SingI ('TGt n) where sing = STGt sing
59instance (KnownNat n) => SingI ('TGt n) where sing = STGt sing
60+instance (KnownNat n) => SingI ('TGe n) where sing = STGe sing
61+instance (KnownNat n) => SingI ('TLt n) where sing = STLt sing
56instance (KnownNat n) => SingI ('TLe n) where sing = STLe sing
62instance (KnownNat n) => SingI ('TLe n) where sing = STLe sing
57instance (KnownSymbol s, SingI s) => SingI ('TRegex s) where sing = STRegex sing
63instance (KnownSymbol s, SingI s) => SingI ('TRegex s) where sing = STRegex sing
58instance (All KnownSymbol ss, SingI ss) => SingI ('TEnum ss) where sing = STEnum sing
64instance (All KnownSymbol ss, SingI ss) => SingI ('TEnum ss) where sing = STEnum sing
60instance Eq (Sing ('TEq n)) where _ == _ = True
66instance Eq (Sing ('TEq n)) where _ == _ = True
67+instance Eq (Sing ('TLt n)) where _ == _ = True
61instance Eq (Sing ('TLe n)) where _ == _ = True
68instance Eq (Sing ('TLe n)) where _ == _ = True
62instance Eq (Sing ('TGt n)) where _ == _ = True
69instance Eq (Sing ('TGt n)) where _ == _ = True
70+instance Eq (Sing ('TGe n)) where _ == _ = True
63instance Eq (Sing ('TRegex t)) where _ == _ = True
71instance Eq (Sing ('TRegex t)) where _ == _ = True
64instance Eq (Sing ('TEnum ss)) where _ == _ = True
72instance Eq (Sing ('TEnum ss)) where _ == _ = True
66data NumberConstraint
74data NumberConstraint
70 deriving (Generic)
80 deriving (Generic)
72data instance Sing (nc :: NumberConstraint) where
82data instance Sing (nc :: NumberConstraint) where
73 SNEq :: Sing n -> Sing ('NEq n)
83 SNEq :: Sing n -> Sing ('NEq n)
74 SNGt :: Sing n -> Sing ('NGt n)
84 SNGt :: Sing n -> Sing ('NGt n)
85+ SNGe :: Sing n -> Sing ('NGe n)
86+ SNLt :: Sing n -> Sing ('NLt n)
75 SNLe :: Sing n -> Sing ('NLe n)
87 SNLe :: Sing n -> Sing ('NLe n)
77instance KnownNat n => SingI ('NEq n) where sing = SNEq sing
89instance KnownNat n => SingI ('NEq n) where sing = SNEq sing
78instance KnownNat n => SingI ('NGt n) where sing = SNGt sing
90instance KnownNat n => SingI ('NGt n) where sing = SNGt sing
91+instance KnownNat n => SingI ('NGe n) where sing = SNGe sing
92+instance KnownNat n => SingI ('NLt n) where sing = SNLt sing
79instance KnownNat n => SingI ('NLe n) where sing = SNLe sing
93instance KnownNat n => SingI ('NLe n) where sing = SNLe sing
81instance Eq (Sing ('NEq n)) where _ == _ = True
95instance Eq (Sing ('NEq n)) where _ == _ = True
96+instance Eq (Sing ('NLt n)) where _ == _ = True
82instance Eq (Sing ('NLe n)) where _ == _ = True
97instance Eq (Sing ('NLe n)) where _ == _ = True
83instance Eq (Sing ('NGt n)) where _ == _ = True
98instance Eq (Sing ('NGt n)) where _ == _ = True
99+instance Eq (Sing ('NGe n)) where _ == _ = True
85data ArrayConstraint
101data ArrayConstraint
86 = AEq Nat
102 = AEq Nat