jsgf committed 382cf82

Add IsString instance for Value to allow direct use of string literals.

Comments (0)

Files changed (2)


 import Data.Ratio (Ratio)
 import Data.Text (Text, pack, unpack)
 import Data.Text.Encoding (decodeUtf8, encodeUtf8)
+import Data.String (IsString(..))
 import Data.Time.Clock (UTCTime)
 import Data.Time.Format (FormatTime, formatTime, parseTime)
 import Data.Attoparsec.Char8 (Number(..))
     rnf Null       = ()
     rnf Missing    = ()
+instance IsString Value where
+    fromString = String . pack
 -- | The empty array.
 emptyArray :: Value
 emptyArray = Array V.empty
 name:            aeson
 license:         BSD3
 license-file:    LICENSE
 category:        Text, Web, JSON