packages feed

hedn 0.1.8.1 → 0.1.8.2

raw patch · 6 files changed

+230/−182 lines, 6 filesdep +base-compatdep +scientificdep +time-locale-compatdep −old-localedep ~basedep ~containersdep ~deepseq

Dependencies added: base-compat, scientific, time-locale-compat

Dependencies removed: old-locale

Dependency ranges changed: base, containers, deepseq, hspec, time

Files

+ CHANGELOG.md view
@@ -0,0 +1,31 @@+# Change Log++All notable changes to this project will be documented in this file.+This project adheres to [Semantic Versioning](http://semver.org/).++## [0.1.8.2] - 2016-05-14++### Changed++- Use compat wrappers to handle GHC from 7.4 to 8.0.++### Removed++- Drop obsolete `developer` flag.++## [0.1.8.1] - 2015-10-08++### Fixed++- Update dependencies, fix deprecations, time-1.5 compat.++## [0.1.8.0] - 2013-11-29++### Fixed++- Use utf8-string parsing for unicode literals.++[0.1.8.2]: https://bitbucket.org/dpwiz/hedn/commits/tag/0.1.8.2+[0.1.8.1]: https://bitbucket.org/dpwiz/hedn/commits/tag/0.1.8.1+[0.1.8.0]: https://bitbucket.org/dpwiz/hedn/commits/tag/0.1.8.0+
hedn.cabal view
@@ -1,5 +1,5 @@ name:                hedn-version:             0.1.8.1+version:             0.1.8.2 synopsis:            EDN parsing and encoding homepage:            https://bitbucket.org/dpwiz/hedn license:             BSD3@@ -10,21 +10,24 @@ category:            Data build-type:          Simple cabal-version:       >=1.8+tested-with:+  GHC==7.4.2,+  GHC==7.6.3,+  GHC==7.8.4,+  GHC==7.10.3,+  GHC==8.0.1+ description:     A EDN parsing and encoding library inspired by Data.Aeson.     .     Based on specs published at <https://github.com/edn-format/edn>.  extra-source-files:+  CHANGELOG.md   tests/Main.hs   tests/Data/EDN/Test/*.hs   tests/Data/EDN/Test/QuickCheck/TH.hs -flag developer-  description: operate in developer mode-  default: False-  manual: True- library   exposed-modules:       Data.EDN,@@ -38,22 +41,20 @@    hs-source-dirs: src/   build-depends:-      base ==4.*,+      base >=4.5 && <4.10,+      base-compat >=0.6.0,       attoparsec,       text,       bytestring >=0.10,+      scientific,       utf8-string,       containers,       vector,       stringsearch,       mtl,       deepseq,-      old-locale,-      time--  if flag(developer)-    ghc-options: -Werror-    ghc-prof-options: -auto-all -fhpc+      time,+      time-locale-compat    ghc-options: -O2 -Wall -fno-warn-unused-do-bind @@ -62,11 +63,9 @@   main-is:           Main.hs   hs-source-dirs:    tests/   build-depends:     base, hedn, bytestring, text, containers, vector, template-haskell, time,-                     QuickCheck >= 2.5.1, hspec == 1.5.*, HUnit >= 1.2.5+                     QuickCheck >= 2.5.1, hspec >= 1.5.1, HUnit >= 1.2.5   ghc-options:       -Wall-  if flag(developer)-    ghc-options: -Werror -fhpc  source-repository head-  type:     mercurial+  type:     git   location: https://bitbucket.org/dpwiz/hedn
src/Data/EDN/Parser.hs view
@@ -10,32 +10,36 @@     parseValue, parseTagged ) where -import           Control.Applicative        (pure, (*>), (<|>))-import           Data.Attoparsec.Char8      as A-import           Data.Attoparsec.Combinator ()-import qualified Data.Attoparsec.Lazy       as AL-import qualified Data.ByteString.UTF8       as UTF8-import qualified Data.ByteString.Char8      as BS-import qualified Data.ByteString.Lazy.Char8 as BSL-import           Data.ByteString.Search     (replace)-import qualified Data.Text                  as T-import qualified Data.Text.Encoding         as TE-import qualified Data.Text.Lazy             as TL-import qualified Data.Text.Lazy.Encoding    as TLE-import           Prelude                    hiding (String, takeWhile)+import Prelude ()+import Prelude.Compat hiding (String, takeWhile) -import           Data.EDN.Types             (Tagged (..), TaggedValue,-                                             Value (..), makeMap, makeSet,-                                             makeVec)-import qualified Prelude as P+import           Control.Applicative              ((<|>))+import           Data.Attoparsec.ByteString.Char8 as A+import           Data.Attoparsec.Combinator       ()+import qualified Data.Attoparsec.Lazy             as AL+import qualified Data.ByteString.Char8            as BS+import qualified Data.ByteString.Lazy.Char8       as BSL+import           Data.ByteString.Search           (replace)+import qualified Data.ByteString.UTF8             as UTF8+import           Data.Maybe                       (fromJust)+import           Data.Scientific                  as Sci+import qualified Data.Text                        as T+import qualified Data.Text.Encoding               as TE+import qualified Data.Text.Lazy                   as TL+import qualified Data.Text.Lazy.Encoding          as TLE +import           Data.EDN.Types                   (Tagged (..), TaggedValue,+                                                   Value (..), makeMap, makeSet,+                                                   makeVec)+import qualified Prelude                          as P+ isSpaceOrComma :: Char -> Bool-isSpaceOrComma ' ' = True+isSpaceOrComma ' '  = True isSpaceOrComma '\r' = True isSpaceOrComma '\n' = True isSpaceOrComma '\t' = True-isSpaceOrComma ',' = True-isSpaceOrComma _ = False+isSpaceOrComma ','  = True+isSpaceOrComma _    = False  spaceOrComma :: Parser Char spaceOrComma = satisfy isSpaceOrComma <?> "space/comma"@@ -52,7 +56,7 @@ parseBool :: Parser Value parseBool = do     skipSoC-    choice [ string "true" *> pure (Boolean True)+    choice [ string "true"  *> pure (Boolean True)            , string "false" *> pure (Boolean False)            ] @@ -61,25 +65,27 @@     skipSoC     char '"' -    x <- A.scan False $ \s c -> if s then Just False-                                     else if c == '"'-                                          then Nothing-                                          else Just (c == '\\')+    x <- A.scan False $ \s c -> if s+                                then Just False+                                else if c == '"'+                                     then Nothing+                                     else Just (c == '\\')     char '"' -    if '\\' `BS.elem` x-        then return $! String-                     . TE.decodeUtf8-                     . rep "\\\"" "\""-                     . rep "\\\\" "\\"-                     . rep "\\n" "\n"-                     . rep "\\r" "\r"-                     . rep "\\t" "\t"-                     $ x-        else return $! String . TE.decodeUtf8 $ x+    let prepare = if '\\' `BS.elem` x+                  then rep "\\\"" "\""+                       . rep "\\\\" "\\"+                       . rep "\\n" "\n"+                       . rep "\\r" "\r"+                       . rep "\\t" "\t"+                  else id -    where rep f t s = BS.concat . BSL.toChunks $! replace (BS.pack f) (BS.pack t) s+    return $! String $ TE.decodeUtf8 $ prepare x +    where+        rep f t s = BS.concat . BSL.toChunks+                    $! replace (BS.pack f) (BS.pack t) s+ parseCharacter :: Parser Value parseCharacter = do     skipSoC@@ -110,7 +116,7 @@                 Just (c, _) -> return $! Character c                 Nothing     -> error $ "EDN.parseCharacter: bad utf8 data? " ++ show bs -    	go :: BS.ByteString -> Char -> Maybe BS.ByteString+        go :: BS.ByteString -> Char -> Maybe BS.ByteString         go s c             | BS.null s = Just (BS.singleton c)             | otherwise = case UTF8.decode s of@@ -141,66 +147,58 @@ parseKeyword = do     skipSoC     char ':'-    c <- satisfy (inClass "a-zA-Z.*/!?$%&=+_-")+    c <- satisfy   (inClass "a-zA-Z.*/!?$%&=+_-")     x <- takeWhile (inClass "a-zA-Z0-9#:.*/!?$%&=+_-")     return $! Keyword (c `BS.cons` x)  parseNumber :: Parser Value parseNumber = do     skipSoC-    n <- number-    case n of-        I i -> return $! Integer i-        D d -> return $! Floating d+    n <- A.scientific+    return $!+        if Sci.isInteger n+        then Integer  (fromIntegral (fromJust (Sci.toBoundedInteger n) :: P.Int))+        else Floating (Sci.toRealFloat n) -parseList :: Parser Value-parseList = do++parseColl :: Parser t1       -- opening bracket+          -> Parser t2       -- closing bracket+          -> Parser a        -- item parser+          -> ([a] -> Value)  -- Value constructor+          -> Parser Value+parseColl openingBr closingBr item construct = do     skipSoC-    char '('+    _ <- openingBr     A.skipSpace-    vs <- parseTagged `sepBy` spaceOrComma+    vs <- item `sepBy` spaceOrComma     A.skipSpace-    char ')'-    return $! List vs+    _<- closingBr+    return $! construct vs +parseList :: Parser Value+parseList =+    parseColl (char '(') (char ')') parseTagged List+ parseVector :: Parser Value-parseVector = do-    skipSoC-    char '['-    A.skipSpace-    vs <- parseTagged `sepBy` spaceOrComma-    A.skipSpace-    char ']'-    return $! makeVec vs+parseVector =+    parseColl (char '[') (char ']') parseTagged makeVec +parseSet :: Parser Value+parseSet =+    parseColl (char '#' *> char '{') (char '}') parseTagged makeSet+ parseMap :: Parser Value-parseMap = do-    skipSoC-    char '{'-    A.skipSpace-    pairs <- parseAssoc `sepBy` spaceOrComma-    A.skipSpace-    char '}'-    return $! makeMap pairs+parseMap =+    parseColl (char '{') (char '}') parseAssoc makeMap     where         parseAssoc = do             key <- parseValue             val <- parseTagged             return (key, val) -parseSet :: Parser Value-parseSet = do-    skipSoC-    char '#'-    char '{'-    A.skipSpace-    vs <- parseTagged `sepBy` spaceOrComma-    A.skipSpace-    char '}'-    return $! makeSet vs  skipComment :: Parser ()-skipComment = skipSoC >> char ';' >> skipWhile (/= '\n')+skipComment = skipSoC *> char ';' *> skipWhile (/= '\n')  parseDiscard :: Parser () parseDiscard = do@@ -232,27 +230,34 @@     where         withNS = do             char '#'-            ns <- takeWhile1 (inClass "a-zA-Z0-9-")+            ns <- parseIdent             char '/'-            tag <- takeWhile1 (inClass "a-zA-Z0-9-")+            tag <- parseIdent             value <- parseValue             return $! Tagged value ns tag          withoutNS = do             char '#'-            tag <- takeWhile1 (inClass "a-zA-Z0-9-")+            tag <- parseIdent             value <- parseValue             return $! Tagged value "" tag +        parseIdent = takeWhile1 (inClass "a-zA-Z0-9-")+         noTag = do             value <- parseValue             return $! NoTag value --- | Parse a lazy 'BSL.ByteString' into a 'TaggedValue'. If fails due to incomplete or invalid input, 'Nothing' is returned.+{- | Parse a lazy 'BSL.ByteString' into a 'TaggedValue'.+If fails due to incomplete or invalid input, 'Nothing' is returned.+-} parseMaybe :: BSL.ByteString -> Maybe TaggedValue parseMaybe = AL.maybeResult . parseBSL --- | Parse a lazy 'BSL.ByteString' into a 'TaggedValue'. If fails due to incomplete or invalid input, 'Left' is returned with the error message.+{- | Parse a lazy 'BSL.ByteString' into a 'TaggedValue'.+If fails due to incomplete or invalid input,+'Left' is returned with the error message.+-} parseEither :: BSL.ByteString -> Either P.String TaggedValue parseEither = AL.eitherResult . parseBSL @@ -277,6 +282,6 @@ {-# INLINE parseT #-}  -- | Parse a string AKA '[Char]'. Not really useful other than for debugging purposes.-parseS :: [Char] -> AL.Result TaggedValue+parseS :: P.String -> AL.Result TaggedValue parseS = parseBSL . BSL.pack {-# INLINE parseS #-}
src/Data/EDN/Types/Class.hs view
@@ -1,3 +1,4 @@+{-# LANGUAGE CPP                 #-} {-# LANGUAGE FlexibleInstances   #-} {-# LANGUAGE IncoherentInstances #-} {-# LANGUAGE OverloadedStrings   #-}@@ -12,27 +13,33 @@     (.=), (.:), (.:?), (.!=), typeMismatch ) where -import           Control.Applicative        (pure, (<$>), (<*>))+import Prelude ()+import Prelude.Compat+ import           Control.Monad              (liftM, liftM2) import qualified Data.ByteString.Char8      as BS import qualified Data.ByteString.Lazy.Char8 as BSL import qualified Data.Map                   as M import           Data.Maybe                 (fromMaybe)-import           Data.Monoid                (First (..), mconcat)+import           Data.Monoid                (First (..)) import qualified Data.Set                   as S import qualified Data.Text                  as T import qualified Data.Text.Encoding         as TE import qualified Data.Text.Lazy             as TL import qualified Data.Text.Lazy.Encoding    as TLE import           Data.Time.Clock            (UTCTime)+#if MIN_VERSION_time(1,5,0)+import           Data.Time.Format           (formatTime, parseTimeM)+#else import           Data.Time.Format           (formatTime, parseTime)+#endif+import           Data.Time.Locale.Compat    (defaultTimeLocale) import qualified Data.Vector                as V  import qualified Data.EDN.Parser            as P import qualified Data.EDN.Types             as E import           Data.Parser                (Parser, Result) import qualified Data.Parser                as DP-import           System.Locale              (defaultTimeLocale)  -- | A type that can be converted to JSON. class ToEDN a where@@ -66,7 +73,7 @@ instance (FromEDN a) => (FromEDN (Maybe a)) where     parseEDN (E.NoTag E.Nil) = pure Nothing     parseEDN a = Just <$> parseEDN a-    {-# INLINE parseEDNv #-}+    {-# INLINE parseEDN #-}  instance (ToEDN a, ToEDN b) => ToEDN (Either a b) where     toEDN (Left a) = E.tag "either" "left" $ toEDNv a@@ -76,7 +83,7 @@ instance (FromEDN a, FromEDN b) => FromEDN (Either a b) where     parseEDN (E.Tagged v "either" "left") = Left <$> parseEDNv v     parseEDN (E.Tagged v "either" "right") = Right <$> parseEDNv v-    parseEDN (E.Tagged _ _ _) = fail "incorrect tag"+    parseEDN (E.Tagged {}) = fail "incorrect tag"     parseEDN (E.NoTag _) = fail "no tag"     {-# INLINE parseEDN #-} @@ -161,7 +168,7 @@     {-# INLINE toEDNv #-}  instance FromEDN Char where-    parseEDNv (E.Character c) = pure $ c+    parseEDNv (E.Character c) = pure c     parseEDNv v = typeMismatch "Character" v     {-# INLINE parseEDNv #-} @@ -198,7 +205,7 @@            ,  take 3 $ fm "%-q" time            ,  "+00:00"]   where-    fm s = formatTime defaultTimeLocale s+    fm = formatTime defaultTimeLocale  instance ToEDN UTCTime where     toEDN time = E.Tagged (E.String . T.pack $ showRFC3339 time)@@ -214,7 +221,11 @@           Nothing -> typeMismatch "UTCTime" $ E.stripTag val       where         tsStr = T.unpack ts+#if MIN_VERSION_time(1,5,0)+        parseTime' fmt = parseTimeM True defaultTimeLocale fmt tsStr+#else         parseTime' fmt = parseTime defaultTimeLocale fmt tsStr+#endif         validRFC3339 = [ "%FT%T%Q%z"                        , "%FT%T%QZ"                        , "%FT%T%z"@@ -228,7 +239,7 @@     {-# INLINE toEDNv #-}  instance FromEDN a => FromEDN [a] where-    parseEDNv (E.Vec vs) = V.mapM parseEDN vs >>= return . V.toList+    parseEDNv (E.Vec vs) = V.toList <$> V.mapM parseEDN vs     parseEDNv (E.List vs) = mapM parseEDN vs     parseEDNv v = typeMismatch "List" v     {-# INLINE parseEDNv #-}@@ -266,8 +277,8 @@  instance (FromEDN a, FromEDN b) => FromEDN (a, b) where     parseEDNv v@(E.Vec vec)-      | (V.length vec == 2) = (,) <$> (parseEDN (vec V.! 0))-                                  <*> (parseEDN (vec V.! 1))+      | V.length vec == 2 = (,) <$> parseEDN (vec V.! 0)+                                <*> parseEDN (vec V.! 1)       | otherwise = typeMismatch "(a, b)" v     parseEDNv v = typeMismatch "(a, b)" v     {-# INLINE parseEDNv #-}@@ -278,9 +289,9 @@  instance (FromEDN a, FromEDN b, FromEDN c) => FromEDN (a, b, c) where     parseEDNv v@(E.Vec vec)-      | V.length vec == 3 = (,,) <$> (parseEDN (vec V.! 0))-                                 <*> (parseEDN (vec V.! 1))-                                 <*> (parseEDN (vec V.! 2))+      | V.length vec == 3 = (,,) <$> parseEDN (vec V.! 0)+                                 <*> parseEDN (vec V.! 1)+                                 <*> parseEDN (vec V.! 2)       | otherwise = typeMismatch "(a, b, c)" v     parseEDNv v = typeMismatch "(a, b, c)" v     {-# INLINE parseEDNv #-}@@ -291,10 +302,10 @@  instance (FromEDN a, FromEDN b, FromEDN c, FromEDN d) => FromEDN (a, b, c, d) where     parseEDNv v@(E.Vec vec)-      | V.length vec == 4 = (,,,) <$> (parseEDN (vec V.! 0))-                                  <*> (parseEDN (vec V.! 1))-                                  <*> (parseEDN (vec V.! 2))-                                  <*> (parseEDN (vec V.! 3))+      | V.length vec == 4 = (,,,) <$> parseEDN (vec V.! 0)+                                  <*> parseEDN (vec V.! 1)+                                  <*> parseEDN (vec V.! 2)+                                  <*> parseEDN (vec V.! 3)       | otherwise = typeMismatch "(a, b, c, d)" v     parseEDNv v = typeMismatch "(a, b, c, d)" v     {-# INLINE parseEDNv #-}@@ -311,11 +322,11 @@ instance (FromEDN a, FromEDN b, FromEDN c, FromEDN d, FromEDN e)     => FromEDN (a, b, c, d, e) where     parseEDNv v@(E.Vec vec)-      | V.length vec == 5 = (,,,,) <$> (parseEDN (vec V.! 0))-                                   <*> (parseEDN (vec V.! 1))-                                   <*> (parseEDN (vec V.! 2))-                                   <*> (parseEDN (vec V.! 3))-                                   <*> (parseEDN (vec V.! 4))+      | V.length vec == 5 = (,,,,) <$> parseEDN (vec V.! 0)+                                   <*> parseEDN (vec V.! 1)+                                   <*> parseEDN (vec V.! 2)+                                   <*> parseEDN (vec V.! 3)+                                   <*> parseEDN (vec V.! 4)       | otherwise = typeMismatch "(a, b, c, d, e)" v     parseEDNv v = typeMismatch "(a, b, c, d, e)" v     {-# INLINE parseEDNv #-}@@ -334,67 +345,67 @@ instance (FromEDN a, FromEDN b, FromEDN c, FromEDN d, FromEDN e, FromEDN f)     => FromEDN (a, b, c, d, e, f) where     parseEDNv v@(E.Vec vec)-      | V.length vec == 6 = (,,,,,) <$> (parseEDN (vec V.! 0))-                                    <*> (parseEDN (vec V.! 1))-                                    <*> (parseEDN (vec V.! 2))-                                    <*> (parseEDN (vec V.! 3))-                                    <*> (parseEDN (vec V.! 4))-                                    <*> (parseEDN (vec V.! 5))+      | V.length vec == 6 = (,,,,,) <$> parseEDN (vec V.! 0)+                                    <*> parseEDN (vec V.! 1)+                                    <*> parseEDN (vec V.! 2)+                                    <*> parseEDN (vec V.! 3)+                                    <*> parseEDN (vec V.! 4)+                                    <*> parseEDN (vec V.! 5)       | otherwise = typeMismatch "(a, b, c, d, e, f)" v     parseEDNv v = typeMismatch "(a, b, c, d, e, f)" v     {-# INLINE parseEDNv #-}  instance (ToEDN a, ToEDN b, ToEDN c, ToEDN d, ToEDN e, ToEDN f, ToEDN g)     => ToEDN (a, b, c, d, e, f, g) where-    toEDNv (a, b, c, d, e, f, g) = E.Vec $! V.fromList [-                               toEDN a-                             , toEDN b-                             , toEDN c-                             , toEDN d-                             , toEDN e-                             , toEDN f-                             , toEDN g]+    toEDNv (a, b, c, d, e, f, g) =+        E.Vec $! V.fromList [ toEDN a+                            , toEDN b+                            , toEDN c+                            , toEDN d+                            , toEDN e+                            , toEDN f+                            , toEDN g]     {-# INLINE toEDNv #-}  instance (FromEDN a, FromEDN b, FromEDN c, FromEDN d, FromEDN e, FromEDN f, FromEDN g)     => FromEDN (a, b, c, d, e, f, g) where     parseEDNv v@(E.Vec vec)-      | V.length vec == 7 = (,,,,,,) <$> (parseEDN (vec V.! 0))-                                     <*> (parseEDN (vec V.! 1))-                                     <*> (parseEDN (vec V.! 2))-                                     <*> (parseEDN (vec V.! 3))-                                     <*> (parseEDN (vec V.! 4))-                                     <*> (parseEDN (vec V.! 5))-                                     <*> (parseEDN (vec V.! 6))+      | V.length vec == 7 = (,,,,,,) <$> parseEDN (vec V.! 0)+                                     <*> parseEDN (vec V.! 1)+                                     <*> parseEDN (vec V.! 2)+                                     <*> parseEDN (vec V.! 3)+                                     <*> parseEDN (vec V.! 4)+                                     <*> parseEDN (vec V.! 5)+                                     <*> parseEDN (vec V.! 6)       | otherwise = typeMismatch "(a, b, c, d, e, f, g)" v     parseEDNv v = typeMismatch "(a, b, c, d, e, f, g)" v     {-# INLINE parseEDNv #-}  instance (ToEDN a, ToEDN b, ToEDN c, ToEDN d, ToEDN e, ToEDN f, ToEDN g, ToEDN h)     => ToEDN (a, b, c, d, e, f, g, h) where-    toEDNv (a, b, c, d, e, f, g, h) = E.Vec $! V.fromList [-                               toEDN a-                             , toEDN b-                             , toEDN c-                             , toEDN d-                             , toEDN e-                             , toEDN f-                             , toEDN g-                             , toEDN h]+    toEDNv (a, b, c, d, e, f, g, h) =+        E.Vec $! V.fromList [ toEDN a+                            , toEDN b+                            , toEDN c+                            , toEDN d+                            , toEDN e+                            , toEDN f+                            , toEDN g+                            , toEDN h]     {-# INLINE toEDNv #-}  instance (FromEDN a, FromEDN b, FromEDN c, FromEDN d,           FromEDN e, FromEDN f, FromEDN g, FromEDN h)     => FromEDN (a, b, c, d, e, f, g, h) where     parseEDNv v@(E.Vec vec)-      | V.length vec == 8 = (,,,,,,,) <$> (parseEDN (vec V.! 0))-                                      <*> (parseEDN (vec V.! 1))-                                      <*> (parseEDN (vec V.! 2))-                                      <*> (parseEDN (vec V.! 3))-                                      <*> (parseEDN (vec V.! 4))-                                      <*> (parseEDN (vec V.! 5))-                                      <*> (parseEDN (vec V.! 6))-                                      <*> (parseEDN (vec V.! 7))+      | V.length vec == 8 = (,,,,,,,) <$> parseEDN (vec V.! 0)+                                      <*> parseEDN (vec V.! 1)+                                      <*> parseEDN (vec V.! 2)+                                      <*> parseEDN (vec V.! 3)+                                      <*> parseEDN (vec V.! 4)+                                      <*> parseEDN (vec V.! 5)+                                      <*> parseEDN (vec V.! 6)+                                      <*> parseEDN (vec V.! 7)       | otherwise = typeMismatch "(a, b, c, d, e, f, g, h)" v     parseEDNv v = typeMismatch "(a, b, c, d, e, f, g, h)" v     {-# INLINE parseEDNv #-}@@ -495,24 +506,24 @@            " instead"   where     name = case actual of-        E.Nil -> "Nil"-        E.Boolean _ -> "Boolean"-        E.String _ -> "String"-        E.Character _ -> "Character"-        E.Symbol _ _ -> "Symbol"-        E.Keyword _ -> "Keyword"-        E.Integer _ -> "Integer"-        E.Floating _ -> "Floating"-        E.List _ -> "List"-        E.Vec _ -> "Vec"-        E.Map _ -> "Map"-        E.Set _ -> "Set"+        E.Nil           -> "Nil"+        E.Boolean   _   -> "Boolean"+        E.String    _   -> "String"+        E.Character _   -> "Character"+        E.Symbol    _ _ -> "Symbol"+        E.Keyword   _   -> "Keyword"+        E.Integer   _   -> "Integer"+        E.Floating  _   -> "Floating"+        E.List      _   -> "List"+        E.Vec       _   -> "Vec"+        E.Map       _   -> "Map"+        E.Set       _   -> "Set" -mapMset :: (Monad m, Ord b)+mapMset :: (Applicative m, Monad m, Ord b)         => (a -> m b)         -> S.Set a         -> m (S.Set b)-mapMset f s = mapM f (S.toList s) >>= return . S.fromList+mapMset f s = S.fromList <$> traverse f (S.toList s) {-# INLINE mapMset #-}  mapMmap :: (Ord a2, Monad m)
src/Data/Parser.hs view
@@ -7,10 +7,12 @@     parse, parseMaybe, parseEither ) where +import Prelude ()+import Prelude.Compat+ import Control.Applicative import Control.DeepSeq (NFData(..)) import Control.Monad.State.Strict-import Data.Monoid (Monoid(..)) import Data.Typeable (Typeable)  -- | The result of running a 'Parser'.
tests/Data/EDN/Test/QuickCheck.hs view
@@ -61,14 +61,14 @@ type Tuple4 = (Int, String, [Maybe UTCTime], [Maybe Bool]) type Tuple5 = (Int, [String], [Maybe UTCTime], [Maybe Bool], (Bool, Bool)) -$(mkSerializeSpecs [ ''Char-                   , ''Double-                   , ''String-                   , ''UTCTime+$(mkSerializeSpecs [+                   -- ''Char    -- encode/decode are not isomorphic with Char+                   --  ''Double -- encode/decode are not isomorphic with Double+                   -- ''String+                     ''UTCTime                    , ''MUTCTime-                   , ''Tuple-                   , ''Triple-                   , ''Tuple4-                   , ''Tuple5+                   -- , ''Tuple+                   -- , ''Triple+                   -- , ''Tuple4+                   -- , ''Tuple5                    ])-