on master help sign in
wrong constraint
7778225Denis Redozubov
src/Data/Schematic.hs+2−2
@@ -28,7 +28,7 @@ import Data.Text as T
28
28
29parseAndValidateJson
29parseAndValidateJson
30 :: forall schema
30 :: forall schema
31− . (J.FromJSON (JsonRepr schema), TopLevel schema, Known (Sing schema))
31+ . (J.FromJSON (JsonRepr schema), TopLevel schema, SingI schema)
32 => J.Value
32 => J.Value
33 -> ParseResult (JsonRepr schema)
33 -> ParseResult (JsonRepr schema)
34parseAndValidateJson v =
34parseAndValidateJson v =
@@ -36,7 +36,7 @@ parseAndValidateJson v =
36 Left s -> DecodingError $ T.pack s
36 Left s -> DecodingError $ T.pack s
37 Right jsonRepr ->
37 Right jsonRepr ->
38 let
38 let
39− validate = validateJsonRepr (known :: Sing schema) [] jsonRepr
39+ validate = validateJsonRepr (sing :: Sing schema) [] jsonRepr
40 res = runIdentity . runValidationTEither $ validate
40 res = runIdentity . runValidationTEither $ validate
41 in case res of
41 in case res of
42 Left em -> ValidationError em
42 Left em -> ValidationError em