on master help sign in
Minor renaming
commit249abb24c98dbd7f93aff0a1303c622eca3099ff authorBryan O'Sullivan <bos@serpentine.com> dateThu 2 Jul 2015, 15:35 (11 years ago) parent2f8e6d2
2 files changed+8−10
tests/Encoders.hs+4−6 tests/Properties.hs+4−4
tests/Encoders.hs+4−6
@@ -132,19 +132,17 @@ gSomeTypeParseJSONObjectWithSingleField = genericParseJSON optsObjectWithSingleF
132132-- Approx encoders/decoders
133133--------------------------------------------------------------------------------
134134
135−type ApproxToJSON = Approx String -> Value
136−
137−thApproxToJSONUnwrap :: ToJSON a => Approx a -> Value
135+thApproxToJSONUnwrap :: Approx String -> Value
138136thApproxToJSONUnwrap = $(mkToJSON optsUnwrapUnaryRecords ''Approx)
139137
140−thApproxParseJSONUnwrap :: FromJSON a => Value -> Parser (Approx a)
138+thApproxParseJSONUnwrap :: Value -> Parser (Approx String)
141139thApproxParseJSONUnwrap = $(mkParseJSON optsUnwrapUnaryRecords ''Approx)
142140
143141
144−thApproxToJSONDefault :: ToJSON a => Approx a -> Value
142+thApproxToJSONDefault :: Approx String -> Value
145143thApproxToJSONDefault = $(mkToJSON defaultOptions ''Approx)
146144
147−thApproxParseJSONDefault :: FromJSON a => Value -> Parser (Approx a)
145+thApproxParseJSONDefault :: Value -> Parser (Approx String)
148146thApproxParseJSONDefault = $(mkParseJSON defaultOptions ''Approx)
149147
150148gApproxToJSONUnwrap :: Approx String -> Value
tests/Properties.hs+4−4
@@ -182,11 +182,11 @@ tests = [
182182 , testProperty "ObjectWithSingleField" (toParseJSON thSomeTypeParseJSONObjectWithSingleField (thSomeTypeToJSONObjectWithSingleField :: SomeTypeToJSON))
183183 ]
184184 , testGroup "Approx" [
185− testProperty "string" (isString . (thApproxToJSONUnwrap ::ApproxToJSON))
186− , testProperty "ObjectWithSingleField" (isObjectWithSingleField . (thApproxToJSONDefault ::ApproxToJSON))
185+ testProperty "string" (isString . thApproxToJSONUnwrap)
186+ , testProperty "ObjectWithSingleField" (isObjectWithSingleField . thApproxToJSONDefault)
187187 , testGroup "roundTrip" [
188− testProperty "string" (toParseJSON thApproxParseJSONUnwrap (thApproxToJSONUnwrap ::ApproxToJSON))
189− , testProperty "ObjectWithSingleField" (toParseJSON thApproxParseJSONDefault (thApproxToJSONDefault ::ApproxToJSON))
188+ testProperty "string" (toParseJSON thApproxParseJSONUnwrap thApproxToJSONUnwrap)
189+ , testProperty "ObjectWithSingleField" (toParseJSON thApproxParseJSONDefault thApproxToJSONDefault)
190190 ]
191191 ]
192192 ]