on master help sign in
Type equality constraints in Data.Schematic.DSL
commit178970f609151babaafb6aeefc38a4005391a200 authorDenis Redozubov <denis.redozubov@gmail.com> dateTue 5 Dec 2017, 18:55 (9 years ago) parent894df72
1 file changed+6−6
src/Data/Schematic/DSL.hs+6−6
src/Data/Schematic/DSL.hs+6−6
@@ -18,9 +18,9 @@ import Data.Vinyl.Functor
1818
1919
2020type Constructor a
21− = forall b. FSubset (FieldsOf a) b (FImage (FieldsOf a) b)
22− => Rec (Tagged (FieldsOf a) :. FieldRepr) b
23− -> JsonRepr ('SchemaObject (FieldsOf a))
21+ = forall fields b. (fields ~ FieldsOf a, FSubset fields b (FImage fields b))
22+ => Rec (Tagged fields :. FieldRepr) b
23+ -> JsonRepr ('SchemaObject fields)
2424
2525withRepr :: Constructor a
2626withRepr = ReprObject . rmap (unTagged . getCompose) . fcast
@@ -66,9 +66,9 @@ type family FieldsOf (s :: Schema) :: [(Symbol, Schema)] where
6666 FieldsOf ('SchemaObject fs) = fs
6767
6868type FieldConstructor fn =
69− forall fs. (Representable (ByField fn fs (FIndex fn fs)))
70− => Repr (ByField fn fs (FIndex fn fs))
71− -> (Tagged fs :. FieldRepr) '(fn, (ByField fn fs (FIndex fn fs)))
69+ forall byField fs. (byField ~ ByField fn fs (FIndex fn fs), Representable byField)
70+ => Repr byField
71+ -> (Tagged fs :. FieldRepr) '(fn, byField)
7272
7373field :: forall fn. KnownSymbol fn => FieldConstructor fn
7474field = Compose . Tagged . constructField (sing :: Sing fn) Proxy