packages feed

web-encodings 0.3.0.8 → 0.3.0.9

raw patch · 1 files changed

+2/−2 lines, 1 filesPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

API changes (from Hackage documentation)

- Web.Encodings.StringLike: class (Eq a, Show a) => StringLike a
+ Web.Encodings.StringLike: class (Eq a, Show a) => StringLike a where dropPrefix porig sorig = helper porig sorig where helper p s | null p && null s = Just empty | null p = Just s | null s = Nothing | head p == head s = helper (tail p) (tail s) | otherwise = Nothing dropPrefix' p c = case dropPrefix p c of { Just x -> x Nothing -> c } dropQuotes s | lengthGE 2 s && head s == '"' && last s == '"' = tail $ init s | otherwise = s chomp s | null s = s chomp s = case last s of { '\n' -> chomp $ init s '\r' -> chomp $ init s _ -> s } chompStart s = case uncons s of { Just ('\r', rest) -> case uncons rest of { Just ('\n', rest') -> rest' _ -> s } Just ('\n', rest) -> rest _ -> s } split c s = let (next, rest) = breakChar c s in if null next then (if null rest then [] else [rest]) else next : split c rest splitOneOf cs s = let (next, rest) = breakChars cs s in if null next then (if null rest then [] else [rest]) else next : splitOneOf cs rest breakCharsMaybe c s | null s = Nothing | head s `elem` c = Just (empty, tail s) | otherwise = do { (next, rest) <- breakCharsMaybe c (tail s); Just (cons (head s) next, rest) } breakCharMaybe c s | null s = Nothing | c == head s = Just (empty, tail s) | otherwise = do { (next, rest) <- breakCharMaybe c (tail s); Just (cons (head s) next, rest) } breakChar c s = fromMaybe (s, empty) $ breakCharMaybe c s breakChars c s = fromMaybe (s, empty) $ breakCharsMaybe c s breakString _ c | null c = (empty, empty) breakString p c = case dropPrefix p c of { Just x -> (empty, x) Nothing -> let x = head c xs = tail c (next, rest) = breakString p xs in (cons x next, rest) } takeLine a = let (x, y) = breakChar '\n' a x' = chomp x in (x', y) takeLineMaybe a = do { (x, y) <- breakCharMaybe '\n' a; Just (chomp x, y) } takeUntilBlank a = let (next, rest) = takeLine a in if null next then ([], rest) else let (nexts, rest') = takeUntilBlank rest in (next : nexts, rest') takeUntilBlankMaybe a = do { (next, rest) <- takeLineMaybe a; if null next then Just ([], rest) else do { (nexts, rest') <- takeUntilBlankMaybe rest; Just (next : nexts, rest') } } lengthLT i _ | i <= 0 = False lengthLT i a | null a = True | otherwise = lengthLT (i - 1) $ tail a lengthGE i = not . lengthLT i

Files

web-encodings.cabal view
@@ -1,10 +1,10 @@ name:            web-encodings-version:         0.3.0.8+version:         0.3.0.9 license:         BSD3 license-file:    LICENSE author:          Michael Snoyman <michael@snoyman.com> maintainer:      Michael Snoyman <michael@snoyman.com>-synopsis:        Encapsulate multiple web encoding in a single package.+synopsis:        Encapsulate multiple web encoding in a single package. (deprecated) description:     The idea is to minimize external dependencies so this is usable in just about any context. category:        Web stability:       stable