packages feed

url 2.1 → 2.1.2

raw patch · 5 files changed

+62/−33 lines, 5 filesdep ~basesetup-changed

Dependency ranges changed: base

Files

LICENSE view
@@ -1,7 +1,19 @@ Copyright (c) 2008 Iavor S. Diatchki -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:+Permission is hereby granted, free of charge, to any person obtaining a copy of+this software and associated documentation files (the "Software"), to deal in+the Software without restriction, including without limitation the rights to+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies+of the Software, and to permit persons to whom the Software is furnished to do+so, subject to the following conditions: -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.+The above copyright notice and this permission notice shall be included in all+copies or substantial portions of the Software. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE+SOFTWARE.
Network/URL.hs view
@@ -22,13 +22,12 @@   , exportParams, importParams   ) where -import Data.Word(Word8)-import Data.Char(isAlpha,isAscii,isDigit)-import Data.List(intersperse)-import Numeric(readHex,showHex)-import Control.Monad+import Data.Char (isAlpha, isAscii, isDigit)+import Data.List (intersperse)+import Data.Word (Word8)+import Numeric   (readHex, showHex) -import Codec.Binary.UTF8.String as UTF8+import qualified Codec.Binary.UTF8.String as UTF8   -- | Contains information about the connection to the host.@@ -49,7 +48,7 @@  -- | Does this host use a \"secure\" protocol (e.g., https). secure :: Host -> Bool-secure x = secure_prot (protocol x)+secure = secure_prot . protocol  -- | Different types of URL. data URLType  = Absolute Host       -- ^ Has a host@@ -107,7 +106,7 @@                       _       -> RawProt as      _                                -> Nothing -  the_host cs = span ok_host cs+  the_host = span ok_host    the_port (':':cs)     = case span isDigit cs of                             ([],_)   -> Nothing@@ -139,7 +138,7 @@ exportHost :: Host -> String exportHost absol = the_prot ++ "://" ++ host absol ++ the_port   where the_prot  = exportProt (protocol absol)-        the_port  = maybe "" (\x -> ":" ++ show x) (port absol)+        the_port  = maybe "" (\x -> ':' : show x) (port absol)  -- | Convert the host part of a URL to a list of \"bytes\". -- WARNING: We output \"raw\" protocols as they are.@@ -165,7 +164,7 @@   the_path    = encString False ok_path (url_path url)   the_params  = case url_params url of                   [] -> ""-                  xs -> "?" ++ exportParams xs+                  xs -> '?' : exportParams xs  exportParams :: [(String,String)] -> String exportParams ps = concat (intersperse "&" $ map a_param ps)@@ -200,7 +199,7 @@ -- | Decode a list of \"bytes\" to a string. -- Performs % and UTF8 decoding. decString :: Bool -> String -> Maybe String-decString b xs = fmap UTF8.decode (decStrBytes b xs)+decString b = fmap UTF8.decode . decStrBytes b  -- Convert a list of \"bytes\" to actual bytes. -- Performs %-decoding.  The boolean specifies if we should turn pluses into@@ -241,7 +240,7 @@ -- XXX: others? check RFC -- | Characters that may appear in the textual representation of a URL ok_url :: Char -> Bool-ok_url c = isDigit c || isAlphaASCII c || c `elem` ".-;:@$_!*'(),/=&?~%"+ok_url c = isDigit c || isAlphaASCII c || c `elem` ".-;:@$_!*'(),/=&?~%+"  -- Misc --------------------------------------------------------------------------------
− Setup.hs
@@ -1,3 +0,0 @@-import Distribution.Simple--main = defaultMain
+ Setup.lhs view
@@ -0,0 +1,8 @@+#! /usr/bin/env runhaskell++> module Main (main) where+>+> import Distribution.Simple (defaultMain)+>+> main :: IO ()+> main = defaultMain
url.cabal view
@@ -1,16 +1,29 @@-Name:           url-Version:        2.1-License:        BSD3-License-file:   LICENSE-Author:         Iavor S. Diatchki-Maintainer:     diatchki@galois.com-Homepage:       http://www.haskell.org/haskellwiki/Url-Category:       Web-Synopsis:       A library for working with URLs.-Description:    A library for working with URLs.-Build-Depends:  base >= 3 && <= 4, utf8-string >= 0.3.4 && < 2-Build-type:     Simple-Extra-source-files: LICENSE-Exposed-modules: Network.URL-GHC-options:    -O2 -Wall+name:         url+version:      2.1.2+category:     Web+synopsis:     A library for working with URLs.+description:  A library for working with URLs.+author:       Iavor S. Diatchki+maintainer:   diatchki@galois.com+license:      BSD3+license-file: LICENSE+homepage:     http://www.haskell.org/haskellwiki/Url +cabal-version: >= 1.6+build-type:    Simple++library+  exposed-modules:+    Network.URL++  build-depends:+    base        >= 3     && <  5,+    utf8-string >= 0.3.4 && <  2++  ghc-options:   -Wall -O2+  if impl(ghc >= 6.8)+    ghc-options: -fwarn-tabs++source-repository head+  type:     git+  location: git://github.com/yav/url.git