on master help sign in
Move deriving Eq ZonedTime to a safer place
da2e953Bryan O'Sullivan
Data/Aeson/Types/Class.hs+1−4
@@ -1,7 +1,6 @@
1{-# LANGUAGE CPP, DeriveDataTypeable, FlexibleContexts, FlexibleInstances,
1{-# LANGUAGE CPP, DeriveDataTypeable, FlexibleContexts, FlexibleInstances,
2 GeneralizedNewtypeDeriving, IncoherentInstances, OverlappingInstances,
2 GeneralizedNewtypeDeriving, IncoherentInstances, OverlappingInstances,
3− OverloadedStrings, UndecidableInstances, ViewPatterns,
3+ OverloadedStrings, UndecidableInstances, ViewPatterns #-}
4− StandaloneDeriving #-}
5{-# OPTIONS_GHC -fno-warn-orphans #-}
4{-# OPTIONS_GHC -fno-warn-orphans #-}
6
5
7#ifdef GENERICS
6#ifdef GENERICS
@@ -625,8 +624,6 @@ instance FromJSON DotNetTime where
625 parseJSON v = typeMismatch "DotNetTime" v
624 parseJSON v = typeMismatch "DotNetTime" v
626 {-# INLINE parseJSON #-}
625 {-# INLINE parseJSON #-}
627
626
628−deriving instance Eq ZonedTime
629−
630instance ToJSON ZonedTime where
627instance ToJSON ZonedTime where
631 toJSON t = String $ pack $ formatTime defaultTimeLocale format t
628 toJSON t = String $ pack $ formatTime defaultTimeLocale format t
632 where
629 where
tests/Properties.hs+3−1
@@ -1,5 +1,5 @@
1{-# LANGUAGE DeriveDataTypeable, OverloadedStrings, RecordWildCards,
1{-# LANGUAGE DeriveDataTypeable, OverloadedStrings, RecordWildCards,
2− ScopedTypeVariables #-}
2+ ScopedTypeVariables, StandaloneDeriving #-}
3{-# OPTIONS_GHC -fno-warn-orphans #-}
3{-# OPTIONS_GHC -fno-warn-orphans #-}
4
4
5import Control.Monad
5import Control.Monad
@@ -127,6 +127,8 @@ instance Arbitrary UFoo where
127main :: IO ()
127main :: IO ()
128main = defaultMain tests
128main = defaultMain tests
129
129
130+deriving instance Eq ZonedTime
131+
130tests :: [Test]
132tests :: [Test]
131tests = [
133tests = [
132 testGroup "regression" [
134 testGroup "regression" [