rdf 0.1.0.7 → 0.1.0.8
raw patch · 2 files changed
+29/−25 lines, 2 filesdep ~attoparsecdep ~bytestringdep ~deepseqPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: attoparsec, bytestring, deepseq, dlist, fgl, text, transformers
API changes (from Hackage documentation)
Files
- rdf.cabal +9/−9
- src/Data/RDF/Internal.hs +20/−16
rdf.cabal view
@@ -1,5 +1,5 @@ name: rdf-version: 0.1.0.7+version: 0.1.0.8 synopsis: Representation and Incremental Processing of RDF Data description: Data structures, parsers, and encoders for RDF data sets based on the@@ -27,14 +27,14 @@ , Data.RDF.Parser.NQuads , Data.RDF.ToRDF other-modules: Data.RDF.Internal- build-depends: base >=4.11 && < 5.0- , attoparsec >=0.13 && <0.14.5- , bytestring >=0.10 && <0.11.5- , deepseq >=1.4 && <1.5- , dlist >= 0.7 && <1.1- , fgl >=5.5 && <5.9- , text >=1.2 && <2.1- , transformers >=0.4 && <0.7+ build-depends: base >=4.11 && <5.0+ , attoparsec >=0.13 && <0.15+ , bytestring >=0.10 && <0.14+ , deepseq >=1.4 && <1.7+ , dlist >= 0.7 && <1.2+ , fgl >=5.5 && <6+ , text >=1.2 && <2.3+ , transformers >=0.4 && <0.8 hs-source-dirs: src ghc-options: -Wall -fwarn-identities
src/Data/RDF/Internal.hs view
@@ -26,6 +26,8 @@ import Data.Char +import Data.Functor+ import Data.String import GHC.Generics@@ -381,22 +383,24 @@ valIRIType = LiteralIRIType <$> (A.string "^^" *> parseEscapedIRI) valLangType = LiteralLangType <$> (A.char '@' *> A.takeWhile1 isLang) isLang c = isAlphaNum c || (c == '-')- escString = unescapeAll <$> A.scan False machine- machine False '\\' = Just True- machine False '"' = Nothing- machine False _ = Just False- machine True _ = Just False- unescapeAll = T.concat . unescapeFrag . T.splitOn "\\"- unescapeFrag [] = []- unescapeFrag (f:fs) = case T.uncons f of- Nothing -> f : unescapeFrag fs- (Just (e, f')) -> T.singleton (unescape e) : f' : unescapeFrag fs- unescape 't' = '\t'- unescape 'b' = '\b'- unescape 'n' = '\n'- unescape 'r' = '\r'- unescape 'f' = '\f'- unescape c = c++ escString :: A.Parser T.Text+ escString = T.pack <$> A.manyTill escChar (A.char '"')++ escChar :: A.Parser Char+ escChar = A.char '\\' *> (unescape <|> pure '\\')+ <|> A.satisfy (/= '"')++ unescape :: A.Parser Char+ unescape =+ (A.char 't' $> '\t')+ <|> (A.char 'b' $> '\b')+ <|> (A.char 'n' $> '\n')+ <|> (A.char 'r' $> '\r')+ <|> (A.char 'f' $> '\f')+ <|> (A.char '"' $> '"')+ <|> (A.char '\\' $> '\\')+ -- | Parse an RDF 'Literal', including the 'LiteralType' if present. parseLiteral :: A.Parser Literal