git.iko.soy/typeable/servant
on master help sign in
aeson-0.10.0.0 fixes
commitcd395a27e85c29f8a899d773df9e1a7114c22183 authorSimon Hengel <sol@typeful.net> dateThu 5 Nov 2015, 09:13 (11 years ago) parent0d8439c
2 files changed+6
servant-examples/tutorial/T1.hs+3 servant-examples/tutorial/T2.hs+3
servant-examples/tutorial/T1.hs+3
@@ -1,3 +1,4 @@
1+{-# LANGUAGE CPP #-}
12{-# LANGUAGE DataKinds #-}
23{-# LANGUAGE DeriveGeneric #-}
34{-# LANGUAGE TypeFamilies #-}
@@ -17,10 +18,12 @@ data User = User
1718 , registration_date :: Day
1819 } deriving (Eq, Show, Generic)
1920
21+#if !MIN_VERSION_aeson(0,10,0)
2022-- orphan ToJSON instance for Day. necessary to derive one for User
2123instance ToJSON Day where
2224 -- display a day in YYYY-mm-dd format
2325 toJSON d = toJSON (showGregorian d)
26+#endif
2427
2528instance ToJSON User
2629
servant-examples/tutorial/T2.hs+3
@@ -1,3 +1,4 @@
1+{-# LANGUAGE CPP #-}
12{-# LANGUAGE DataKinds #-}
23{-# LANGUAGE DeriveGeneric #-}
34{-# LANGUAGE TypeFamilies #-}
@@ -17,10 +18,12 @@ data User = User
1718 , registration_date :: Day
1819 } deriving (Eq, Show, Generic)
1920
21+#if !MIN_VERSION_aeson(0,10,0)
2022-- orphan ToJSON instance for Day. necessary to derive one for User
2123instance ToJSON Day where
2224 -- display a day in YYYY-mm-dd format
2325 toJSON d = toJSON (showGregorian d)
26+#endif
2427
2528instance ToJSON User
2629