diff --git a/Data/Yaml.hs b/Data/Yaml.hs
--- a/Data/Yaml.hs
+++ b/Data/Yaml.hs
@@ -84,9 +84,13 @@
 import Data.Text.Encoding.Error (lenientDecode)
 import qualified Data.HashMap.Strict as M
 import Data.Typeable
-import Data.Attoparsec.ByteString (parseOnly)
-import Data.Aeson.Parser (value)
 import qualified Data.HashSet as HashSet
+import Data.Text.Read
+#if MIN_VERSION_aeson(0, 7, 0)
+import Data.Scientific (fromFloatDigits)
+#else
+import Data.Attoparsec.Number
+#endif
 
 encode :: ToJSON a => a -> ByteString
 encode obj = unsafePerformIO $
@@ -210,7 +214,13 @@
     | t `elem` ["null", "Null", "NULL", "~", ""] = Null
     | any (t `isLike`) ["y", "yes", "on", "true"] = Bool True
     | any (t `isLike`) ["n", "no", "off", "false"] = Bool False
-    | Right (Number n) <- parseOnly value (encodeUtf8 t) = Number n
+#if MIN_VERSION_aeson(0, 7, 0)
+    | Right (x, "") <- signed decimal t = Number $ fromIntegral (x :: Integer)
+    | Right (x, "") <- double t = Number $ fromFloatDigits x
+#else
+    | Right (x, "") <- signed decimal t = Number $ I x
+    | Right (x, "") <- double t = Number $ D x
+#endif
     | otherwise = String t
   where x `isLike` ref = x `elem` [ref, T.toUpper ref, titleCased]
           where titleCased = toUpper (T.head ref) `T.cons` T.tail ref
diff --git a/test/json.yaml b/test/json.yaml
--- a/test/json.yaml
+++ b/test/json.yaml
@@ -6,3 +6,4 @@
 hash:
   key1: value1
   key2: value2
+extrastring: 1234-foo
diff --git a/test/main.hs b/test/main.hs
--- a/test/main.hs
+++ b/test/main.hs
@@ -34,6 +34,7 @@
               , number :: Int
               , anArray  :: Vector Text
               , hash   :: HashMap Text Text
+              , extrastring :: Text
               } deriving (Show, Eq)
 
 deriveJSON defaultOptions ''TestJSON
@@ -119,6 +120,7 @@
                           , number = 2
                           , anArray = V.fromList ["a", "b"]
                           , hash = HM.fromList [("key1", "value1"), ("key2", "value2")]
+                          , extrastring = "1234-foo"
                           }
 
     describe "round-tripping of special scalars" $ do
diff --git a/yaml.cabal b/yaml.cabal
--- a/yaml.cabal
+++ b/yaml.cabal
@@ -1,5 +1,5 @@
 name:            yaml
-version:         0.8.5.3
+version:         0.8.5.4
 license:         BSD3
 license-file:    LICENSE
 author:          Michael Snoyman <michael@snoyman.com>, Anton Ageev <antage@gmail.com>,Kirill Simonov 
@@ -49,6 +49,7 @@
                    , vector
                    , text
                    , attoparsec
+                   , scientific
     exposed-modules: Text.Libyaml
                      Data.Yaml
     ghc-options:     -Wall
