packages feed

nationstates 0.1.0.1 → 0.1.0.2

raw patch · 4 files changed

+13/−11 lines, 4 filesdep −splitPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

Dependencies removed: split

API changes (from Hackage documentation)

- NationStates.Core: splitDropBlanks :: Eq a => [a] -> [a] -> [[a]]
+ NationStates.Core: wordsBy :: (a -> Bool) -> [a] -> [[a]]

Files

NationStates/Core.hs view
@@ -22,7 +22,7 @@     Context(..),      -- * Utilities-    splitDropBlanks,+    wordsBy,     readMaybe,     expect,     expected,@@ -38,7 +38,6 @@ import Data.Functor.Compose import qualified Data.Foldable as F import Data.List-import Data.List.Split import Data.Monoid import Data.Map (Map) import qualified Data.Map as Map@@ -194,15 +193,19 @@         (k, v) <- Map.toList $ queryOptions q ]  --- | Split a string by a separator, dropping empty substrings.+-- | Split a list by the given predicate, dropping empty sublists. ----- >>> splitDropBlanks "," "the_vines,motesardo-east_adanzi,yellowapple"+-- >>> wordsBy (== ',') "the_vines,motesardo-east_adanzi,yellowapple" -- ["the_vines", "montesardo-east_adanzi", "yellowapple"] ----- >>> splitDropBlanks "," ""+-- >>> wordsBy (== ',') "" -- []-splitDropBlanks :: Eq a => [a] -> [a] -> [[a]]-splitDropBlanks = split . dropBlanks . dropDelims . onSublist+wordsBy :: (a -> Bool) -> [a] -> [[a]]+wordsBy p s = case dropWhile p s of+    [] -> []+    s' ->+        let (w, s'') = break p s'+        in  w : wordsBy p s''  -- | Parse an input string using the given parser function. --
NationStates/Nation.hs view
@@ -165,7 +165,7 @@ -- -- > ["jlink","translenia","the_vines"] endorsements :: Nation [String]-endorsements = Nation . fmap (splitDropBlanks ",") $+endorsements = Nation . fmap (wordsBy (== ',')) $     makeNS "endorsements" "ENDORSEMENTS"  -- | General assembly vote.
NationStates/Region.hs view
@@ -99,7 +99,7 @@ -- -- > ["urmanian","enatai","unfitting_doors","lykosia","trotterdam"] nations :: Region [String]-nations = Region . fmap (splitDropBlanks ":") $ makeNS "nations" "NATIONS"+nations = Region . fmap (wordsBy (== ':')) $ makeNS "nations" "NATIONS"  -- | Region delegate. --
nationstates.cabal view
@@ -1,5 +1,5 @@ name: nationstates-version: 0.1.0.1+version: 0.1.0.2 synopsis: NationStates API client description:     NationStates API client@@ -32,7 +32,6 @@         http-client-tls,         http-types,         multiset,-        split,         transformers,         xml     default-language: Haskell2010