@@ -7,7 +7,7 @@
7{-# LANGUAGE OverloadedStrings #-}
7{-# LANGUAGE OverloadedStrings #-}
9import Data.Aeson (decode, encode)
9import Data.Aeson (decode, encode)
10−import Data.Aeson.TH (deriveJSON)
10+import Data.Aeson.TH (deriveJSON, defaultOptions)
11import qualified Data.ByteString.Lazy.Char8 as BL
11import qualified Data.ByteString.Lazy.Char8 as BL
13data Coord = Coord { x :: Double, y :: Double }
13data Coord = Coord { x :: Double, y :: Double }
@@ -19,7 +19,7 @@ data Coord = Coord { x :: Double, y :: Double }
19-- names of the type's fields. We don't want to transform them, so we
19-- names of the type's fields. We don't want to transform them, so we
20-- use the identity function.
20-- use the identity function.
22−$(deriveJSON id ''Coord)
22+$(deriveJSON defaultOptions ''Coord)
24main :: IO ()
24main :: IO ()