@@ -57,7 +57,7 @@ instance coercePropsNil
57
57
∷ CoerceProps Nil Nil any
58
58
59
59
else instance coercePropsCons
60
- ∷ (CoerceProp a b (n ::: debugPath ))
60
+ ∷ (CoerceProp a b (n ::: debugPath ), CoerceProps t t' debugPath )
61
61
⇒ CoerceProps (Cons n a t ) (Cons n b t' ) debugPath
62
62
63
63
-- | Handle missing field using Opt
@@ -108,15 +108,18 @@ class CoerceProp given expected (debugPath ∷ SList) | expected → debugPath
108
108
-- -- |
109
109
-- -- | The rest is handling errors and providing intances
110
110
-- -- | for well known polymorphic types like `Maybe`, `Either`...
111
- instance coercePropOptValue
111
+ instance coercePropOptValues
112
112
∷ (CoerceProp a b p )
113
113
⇒ CoerceProp (Opt a ) (Opt b ) p
114
- else instance coercePropValue
114
+ else instance coercePropOptValue
115
115
∷ (CoerceProp a b p )
116
116
⇒ CoerceProp a (Opt b ) p
117
117
else instance coercePropRecord
118
- ∷ (RowToList e el , RowToList g gl , CoerceProps el gl p )
119
- ⇒ CoerceProp { | e } { | g } p
118
+ ∷ (RowToList e el , RowToList g gl , CoerceProps gl el p )
119
+ ⇒ CoerceProp { | g } { | e } p
120
+
121
+ else instance coercePropMatch
122
+ :: CoerceProp a a p
120
123
121
124
-- | These instances are provided to allow coercing over popular types
122
125
@@ -146,37 +149,33 @@ else instance coercePropEffect
146
149
147
150
-- | These instances are provided only for nice debuging experience.
148
151
149
- else instance coercePropStringMatch ∷ CoerceProp String String p
150
- else instance coercePropStringGivenMismatch
151
- ∷ (RenderPath p p' , TypeMismatchErr String a p msg , Fail msg )
152
- ⇒ CoerceProp String a p
153
- else instance coercePropStringExpectedMismatch
154
- ∷ (RenderPath p p' , TypeMismatchErr String a p msg , Fail msg )
155
- ⇒ CoerceProp a String p
156
-
157
- else instance coercePropIntMatch ∷ CoerceProp Int Int p
158
- else instance coercePropIntGivenMismatch
159
- ∷ (RenderPath p p' , TypeMismatchErr Int a p msg , Fail msg )
160
- ⇒ CoerceProp Int a p
161
152
else instance coercePropIntExpectedMismatch
162
153
∷ (RenderPath p p' , TypeMismatchErr a Int p msg , Fail msg )
163
154
⇒ CoerceProp a Int p
155
+ else instance coercePropIntGivenMismatch
156
+ ∷ (RenderPath p p' , TypeMismatchErr Int a p msg , Fail msg )
157
+ ⇒ CoerceProp Int a p
158
+
159
+ else instance coercePropStringExpectedMismatch
160
+ ∷ (RenderPath p p' , TypeMismatchErr a String p msg , Fail msg )
161
+ ⇒ CoerceProp a String p
162
+ else instance coercePropStringGivenMismatch
163
+ ∷ (RenderPath p p' , TypeMismatchErr String a p msg , Fail msg )
164
+ ⇒ CoerceProp String a p
164
165
165
- else instance coercePropNumberMatch ∷ CoerceProp Number Number p
166
- else instance coercePropNumberGivenMismatch
167
- ∷ (RenderPath p p' , TypeMismatchErr Number a p msg , Fail msg )
168
- ⇒ CoerceProp Number a p
169
166
else instance coercePropNumberExpectedMismatch
170
167
∷ (RenderPath p p' , TypeMismatchErr a Number p msg , Fail msg )
171
168
⇒ CoerceProp a Number p
169
+ else instance coercePropNumberGivenMismatch
170
+ ∷ (RenderPath p p' , TypeMismatchErr Number a p msg , Fail msg )
171
+ ⇒ CoerceProp Number a p
172
172
173
- else instance coercePropBooleanMatch ∷ CoerceProp Boolean Boolean p
174
- else instance coercePropBooleanGivenMismatch
175
- ∷ (RenderPath p p' , TypeMismatchErr Boolean a p msg , Fail msg )
176
- ⇒ CoerceProp Boolean a p
177
173
else instance coercePropBooleanExpectedMismatch
178
174
∷ (RenderPath p p' , TypeMismatchErr a Boolean p msg , Fail msg )
179
175
⇒ CoerceProp a Boolean p
176
+ else instance coercePropBooleanGivenMismatch
177
+ ∷ (RenderPath p p' , TypeMismatchErr Boolean a p msg , Fail msg )
178
+ ⇒ CoerceProp Boolean a p
180
179
181
180
-- else instance coercePropPoly ∷ CoerceProp a b b p
182
181
0 commit comments