@@ -288,6 +288,8 @@ object = Object . M.fromList
288-- instance ToJSON Coord where
288-- instance ToJSON Coord where
289-- toJSON (Coord x y) = 'object' [\"x\" '.=' x, \"y\" '.=' y]
289-- toJSON (Coord x y) = 'object' [\"x\" '.=' x, \"y\" '.=' y]
292+-- This example assumes the OverloadedStrings language option is enabled.
291class ToJSON a where
293class ToJSON a where
292 toJSON :: a -> Value
294 toJSON :: a -> Value
@@ -310,6 +312,8 @@ class ToJSON a where
310-- \-- A non-'Object' value is of the wrong type, so use 'mzero' to fail.
312-- \-- A non-'Object' value is of the wrong type, so use 'mzero' to fail.
311-- parseJSON _ = 'mzero'
313-- parseJSON _ = 'mzero'
316+-- This example assumes the OverloadedStrings language option is enabled.
313class FromJSON a where
317class FromJSON a where
314 parseJSON :: Value -> Parser a
318 parseJSON :: Value -> Parser a