urlencoded 0.2.0.0 → 0.3.0.0
raw patch · 3 files changed
+23/−37 lines, 3 filesdep ~basedep ~mtlsetup-changedPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: base, mtl
API changes (from Hackage documentation)
- Data.URLEncoded: instance (URLEncode a) => URLEncode (Maybe a)
+ Data.URLEncoded: importURI :: MonadError e m => URI -> m URLEncoded
+ Data.URLEncoded: instance URLEncode a => URLEncode (Maybe a)
- Data.URLEncoded: (%!) :: (URLShow a) => URLEncoded -> a -> Maybe String
+ Data.URLEncoded: (%!) :: URLShow a => URLEncoded -> a -> Maybe String
- Data.URLEncoded: importString :: (MonadError e m) => String -> m URLEncoded
+ Data.URLEncoded: importString :: MonadError e m => String -> m URLEncoded
- Data.URLEncoded: lookup :: (URLShow a) => a -> URLEncoded -> Maybe String
+ Data.URLEncoded: lookup :: URLShow a => a -> URLEncoded -> Maybe String
- Data.URLEncoded: lookupAll :: (URLShow a) => a -> URLEncoded -> [String]
+ Data.URLEncoded: lookupAll :: URLShow a => a -> URLEncoded -> [String]
- Data.URLEncoded: lookupDefault :: (URLShow a) => String -> a -> URLEncoded -> String
+ Data.URLEncoded: lookupDefault :: URLShow a => String -> a -> URLEncoded -> String
- Data.URLEncoded: urlEncode :: (URLEncode a) => a -> URLEncoded
+ Data.URLEncoded: urlEncode :: URLEncode a => a -> URLEncoded
- Data.URLEncoded: urlShow :: (URLShow a) => a -> String
+ Data.URLEncoded: urlShow :: URLShow a => a -> String
Files
- Setup.lhs +1/−29
- src/Data/URLEncoded.hs +7/−0
- urlencoded.cabal +15/−8
Setup.lhs view
@@ -1,31 +1,3 @@ #!/usr/bin/env runhaskell > import Distribution.Simple-> import Distribution.PackageDescription-> import Distribution.Simple.Setup ( defaultBuildFlags )-> import Distribution.Simple.LocalBuildInfo ( buildDir )-> import Distribution.Simple.Utils ( rawSystemExit )-> import Distribution.Verbosity ( normal )-> import System.FilePath ( (</>) )-> import Control.Monad ( forM_, when )-> import Data.Char ( toLower )--> main = defaultMainWithHooks $ handleTestExes simpleUserHooks--> handleTestExes hooks = hooks { instHook = dropTestExes instHook-> , copyHook = dropTestExes copyHook-> , runTests = runTestExes-> }-> where-> dropTestExes hook pkg =-> let nonTest = filter (not . isTestExe) (executables pkg)-> in hook hooks $ pkg { executables = nonTest }->-> runTestExes args _unknown pkg lbi = do-> buildHook hooks pkg lbi hooks defaultBuildFlags-> forM_ (executables pkg) $ \exe ->-> let testPath = buildDir lbi </> exeName exe </> exeName exe-> in when (isTestExe exe) $ rawSystemExit normal testPath args--> isTestExe exe =-> let fields = customFieldsBI (buildInfo exe)-> in ["true"] == [ map toLower val | ("x-test-executable", val) <- fields ]+> main = defaultMain
src/Data/URLEncoded.hs view
@@ -14,6 +14,7 @@ , empty , importString , importList+ , importURI , (%=) , (%=?) , (%&)@@ -176,6 +177,12 @@ ) unknown -> error $ "impossible: " ++ show unknown unesc = unEscapeString . intercalate "%20" . unintercalate "+"++importURI :: MonadError e m => URI -> m URLEncoded+importURI u = case uriQuery u of+ ('?':s) -> importString s+ [] -> return empty+ q -> fail $ "Unexpected query for URI: " ++ show q -- |Return the /first/ value for the given key, or throw an error if the -- key is not present in the URLEncoded data.
urlencoded.cabal view
@@ -1,6 +1,6 @@ name: urlencoded Cabal-Version: >= 1.6-version: 0.2.0.0+version: 0.3.0.0 synopsis: Generate or process x-www-urlencoded data description: Generate or process x-www-urlencoded data as it@@ -15,8 +15,13 @@ author: Josh Hoyt maintainer: joshhoyt@gmail.com build-type: Custom++Flag Test+ Description: Build the test executable+ Default: False+ Library- build-depends: base == 4.*, network == 2.2.*, mtl, split == 0.1.*+ build-depends: base == 4.*, network == 2.2.*, mtl == 1.1.*, split == 0.1.* ghc-options: -Wall hs-source-dirs: src exposed-modules: Data.URLEncoded@@ -24,12 +29,14 @@ -- This executable is not installed by the (custom) Setup program. It is -- used by the test hook (cabal test) Executable test- build-depends:- base == 4.*,- network == 2.2.*,- mtl,- QuickCheck >= 1.2 && < 1.3,- split == 0.1.*+ if flag(test)+ Buildable: True+ build-depends:+ QuickCheck >= 1.2 && < 1.3++ else+ Buildable: False+ GHC-Options: -Wall Main-is: TestDriver.hs HS-Source-Dirs: src, test