@@ -304,13 +304,25 @@ object = Object . M.fromList
304304--
305305-- An example type and instance:
306306--
307−-- @data Coord { x :: Double, y :: Double }
307+-- @{-\# LANGUAGE OverloadedStrings #-}
308+--
309+-- data Coord { x :: Double, y :: Double }
308310--
309311-- instance ToJSON Coord where
310312-- toJSON (Coord x y) = 'object' [\"x\" '.=' x, \"y\" '.=' y]
311313-- @
312314--
313−-- This example assumes the OverloadedStrings language option is enabled.
315+-- We use the @OverloadedStrings@ language extension so that we can
316+-- write 'Text' values as normal double-quoted strings.
317+--
318+-- If you do not want to write your own 'ToJSON' instances, you have
319+-- two options:
320+--
321+-- * The 'Data.Aeson.TH' module will automatically derive an instance
322+-- for you with a single line of code.
323+--
324+-- * The 'Data.Aeson.Generic' module will work with most data types
325+-- that are instances of 'Data' (but note, this can be slow).
314326class ToJSON a where
315327 toJSON :: a -> Value
316328
@@ -328,7 +340,9 @@ class ToJSON a where
328340--
329341-- An example type and instance:
330342--
331−-- @data Coord { x :: Double, y :: Double }
343+-- @{-\# LANGUAGE OverloadedStrings #-}
344+--
345+-- data Coord { x :: Double, y :: Double }
332346--
333347-- instance FromJSON Coord where
334348-- parseJSON ('Object' v) = Coord '<$>'
@@ -339,7 +353,17 @@ class ToJSON a where
339353-- parseJSON _ = 'mzero'
340354-- @
341355--
342−-- This example assumes the OverloadedStrings language option is enabled.
356+-- We use the @OverloadedStrings@ language extension so that we can
357+-- write 'Text' values as normal double-quoted strings.
358+--
359+-- If you do not want to write your own 'FromJSON' instances, you have
360+-- two options:
361+--
362+-- * The 'Data.Aeson.TH' module will automatically derive an instance
363+-- for you with a single line of code.
364+--
365+-- * The 'Data.Aeson.Generic' module will work with most data types
366+-- that are instances of 'Data' (but note, this can be slow).
343367class FromJSON a where
344368 parseJSON :: Value -> Parser a
345369