Skip to content

Commit

Permalink
Merge
Browse files Browse the repository at this point in the history
  • Loading branch information
bos committed Nov 20, 2012
2 parents 80e5147 + 5781d6b commit 48a750f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Data/Aeson/TH.hs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ import qualified Data.Vector as V
instance 'ToJSON' a => 'ToJSON' (D a) where
'toJSON' =
\value ->
\\value ->
case value of
Nullary ->
'object' [T.pack \"Nullary\" .= 'toJSON' ([] :: [()])]
Expand All @@ -73,7 +73,7 @@ instance 'ToJSON' a => 'ToJSON' (D a) where
@
instance 'FromJSON' a => 'FromJSON' (D a) where
'parseJSON' =
\value ->
\\value ->
case value of
'Object' obj ->
case H.toList obj of
Expand Down Expand Up @@ -234,7 +234,7 @@ The above (ToJSON a) constraint is not necessary and perhaps undesirable.
-- @
-- instance 'ToJSON' Foo where
-- 'toJSON' =
-- \value -> case value of
-- \\value -> case value of
-- Foo arg1 arg2 -> 'Array' $ 'V.create' $ do
-- mv <- 'VM.unsafeNew' 2
-- 'VM.unsafeWrite' mv 0 ('toJSON' arg1)
Expand Down Expand Up @@ -281,7 +281,7 @@ deriveToJSON withField name =
-- This will splice in the following code:
--
-- @
-- \value -> case value of Foo arg1 -> 'toJSON' arg1
-- \\value -> case value of Foo arg1 -> 'toJSON' arg1
-- @
mkToJSON :: (String -> String) -- ^ Function to change field names.
-> Name -- ^ Name of the type to encode.
Expand Down Expand Up @@ -406,7 +406,7 @@ encodeArgs withExp withField (ForallC _ _ con) =
-- @
-- instance 'FromJSON' Foo where
-- 'parseJSON' =
-- \value -> case value of
-- \\value -> case value of
-- 'Array' arr ->
-- if (V.length arr == 2)
-- then Foo \<$\> 'parseJSON' (arr `V.unsafeIndex` 0)
Expand Down

0 comments on commit 48a750f

Please sign in to comment.