on master help sign in
Add Typeable instance
4b5a0cdBryan O'Sullivan
Data/Aeson/Types.hs+4−1
@@ -1,3 +1,5 @@
1+{-# LANGUAGE DeriveDataTypeable #-}
2+
1module Data.Aeson.Types
3module Data.Aeson.Types
2 (
4 (
3 Array
5 Array
@@ -15,6 +17,7 @@ import Data.Map (Map)
15import Data.Text (Text, pack, unpack)
17import Data.Text (Text, pack, unpack)
16import Data.Time.Clock (UTCTime)
18import Data.Time.Clock (UTCTime)
17import Data.Time.Format (formatTime, parseTime)
19import Data.Time.Format (formatTime, parseTime)
20+import Data.Typeable (Typeable)
18import Data.Vector (Vector)
21import Data.Vector (Vector)
19import System.Locale (defaultTimeLocale)
22import System.Locale (defaultTimeLocale)
20import qualified Data.Map as M
23import qualified Data.Map as M
@@ -29,7 +32,7 @@ data Value = Object Object
29 | Number Double
32 | Number Double
30 | Bool !Bool
33 | Bool !Bool
31 | Null
34 | Null
32− deriving (Eq, Show)
35+ deriving (Eq, Show, Typeable)
33
36
34(.=) :: ToJSON a => Text -> a -> Object
37(.=) :: ToJSON a => Text -> a -> Object
35name .= value = M.singleton name (toJSON value)
38name .= value = M.singleton name (toJSON value)