on master help sign in
Merge
ffdc19eBryan O'Sullivan
Data/Aeson/TH.hs+5−5
@@ -46,7 +46,7 @@ import qualified Data.Vector as V
46
46
47instance 'ToJSON' a => 'ToJSON' (D a) where
47instance 'ToJSON' a => 'ToJSON' (D a) where
48 'toJSON' =
48 'toJSON' =
49− \value ->
49+ \\value ->
50 case value of
50 case value of
51 Nullary ->
51 Nullary ->
52 'object' [T.pack \"Nullary\" .= 'toJSON' ([] :: [()])]
52 'object' [T.pack \"Nullary\" .= 'toJSON' ([] :: [()])]
@@ -73,7 +73,7 @@ instance 'ToJSON' a => 'ToJSON' (D a) where
73@
73@
74instance 'FromJSON' a => 'FromJSON' (D a) where
74instance 'FromJSON' a => 'FromJSON' (D a) where
75 'parseJSON' =
75 'parseJSON' =
76− \value ->
76+ \\value ->
77 case value of
77 case value of
78 'Object' obj ->
78 'Object' obj ->
79 case H.toList obj of
79 case H.toList obj of
@@ -234,7 +234,7 @@ The above (ToJSON a) constraint is not necessary and perhaps undesirable.
234-- @
234-- @
235-- instance 'ToJSON' Foo where
235-- instance 'ToJSON' Foo where
236-- 'toJSON' =
236-- 'toJSON' =
237−-- \value -> case value of
237+-- \\value -> case value of
238-- Foo arg1 arg2 -> 'Array' $ 'V.create' $ do
238-- Foo arg1 arg2 -> 'Array' $ 'V.create' $ do
239-- mv <- 'VM.unsafeNew' 2
239-- mv <- 'VM.unsafeNew' 2
240-- 'VM.unsafeWrite' mv 0 ('toJSON' arg1)
240-- 'VM.unsafeWrite' mv 0 ('toJSON' arg1)
@@ -281,7 +281,7 @@ deriveToJSON withField name =
281-- This will splice in the following code:
281-- This will splice in the following code:
282--
282--
283-- @
283-- @
284−-- \value -> case value of Foo arg1 -> 'toJSON' arg1
284+-- \\value -> case value of Foo arg1 -> 'toJSON' arg1
285-- @
285-- @
286mkToJSON :: (String -> String) -- ^ Function to change field names.
286mkToJSON :: (String -> String) -- ^ Function to change field names.
287 -> Name -- ^ Name of the type to encode.
287 -> Name -- ^ Name of the type to encode.
@@ -406,7 +406,7 @@ encodeArgs withExp withField (ForallC _ _ con) =
406-- @
406-- @
407-- instance 'FromJSON' Foo where
407-- instance 'FromJSON' Foo where
408-- 'parseJSON' =
408-- 'parseJSON' =
409−-- \value -> case value of
409+-- \\value -> case value of
410-- 'Array' arr ->
410-- 'Array' arr ->
411-- if (V.length arr == 2)
411-- if (V.length arr == 2)
412-- then Foo \<$\> 'parseJSON' (arr `V.unsafeIndex` 0)
412-- then Foo \<$\> 'parseJSON' (arr `V.unsafeIndex` 0)