on master help sign in
Modernizing the TH example.
commit26835ccdc85684b03861deafe3609c4d60ab6d3d authorReto Kramer <kramer@acm.org> dateMon 28 Apr 2014, 21:19 (12 years ago) parentfef021a
1 file changed+2−2
examples/TemplateHaskell.hs+2−2
examples/TemplateHaskell.hs+2−2
@@ -7,7 +7,7 @@
77{-# LANGUAGE OverloadedStrings #-}
88
99import Data.Aeson (decode, encode)
10−import Data.Aeson.TH (deriveJSON)
10+import Data.Aeson.TH (deriveJSON, defaultOptions)
1111import qualified Data.ByteString.Lazy.Char8 as BL
1212
1313data Coord = Coord { x :: Double, y :: Double }
@@ -19,7 +19,7 @@ data Coord = Coord { x :: Double, y :: Double }
1919-- names of the type's fields. We don't want to transform them, so we
2020-- use the identity function.
2121
22−$(deriveJSON id ''Coord)
22+$(deriveJSON defaultOptions ''Coord)
2323
2424main :: IO ()
2525main = do