@@ -1,3 +1,4 @@
1{-# LANGUAGE DataKinds #-}
2{-# LANGUAGE DataKinds #-}
2{-# LANGUAGE DeriveGeneric #-}
3{-# LANGUAGE DeriveGeneric #-}
3{-# LANGUAGE TypeFamilies #-}
4{-# LANGUAGE TypeFamilies #-}
@@ -17,10 +18,12 @@ data User = User
17 , registration_date :: Day
18 , registration_date :: Day
18 } deriving (Eq, Show, Generic)
19 } deriving (Eq, Show, Generic)
21+#if !MIN_VERSION_aeson(0,10,0)
20-- orphan ToJSON instance for Day. necessary to derive one for User
22-- orphan ToJSON instance for Day. necessary to derive one for User
21instance ToJSON Day where
23instance ToJSON Day where
22 -- display a day in YYYY-mm-dd format
24 -- display a day in YYYY-mm-dd format
23 toJSON d = toJSON (showGregorian d)
25 toJSON d = toJSON (showGregorian d)
25instance ToJSON User
28instance ToJSON User