Extra 1.30 → 1.33
raw patch · 4 files changed
+15/−39 lines, 4 filesdep −HaXmlPVP ok
version bump matches the API change (PVP)
Dependencies removed: HaXml
API changes (from Hackage documentation)
- Extra.HaXml: cfilterToElem :: CFilter -> Element
- Extra.HaXml: mkDocument :: String -> Element -> Document
- Extra.HaXml: mkTxt :: String -> CFilter
- Extra.HaXml: showXML :: String -> CFilter -> Doc
+ Test.QuickCheck.Properties: isIdempotent :: (Arbitrary a, Eq a, Show a) => (a -> a) -> Property
+ Test.QuickCheck.Properties: isIdempotentBy :: (Arbitrary a, Eq a, Show a) => (a -> a) -> Gen a -> Property
Files
- Extra.cabal +5/−5
- Extra/HaXml.hs +0/−33
- Extra/URI.hs +1/−1
- Test/QuickCheck/Properties.hs +9/−0
Extra.cabal view
@@ -1,22 +1,22 @@ Name: Extra-Version: 1.30+Version: 1.33 License: BSD3 License-File: COPYING Author: David Fox Category: Unclassified Description: A hodge-podge of functions and modules that do not have a better home Maintainer: David Fox <david@seereason.com>-Homepage: http://seereason.org/-Build-Depends: base >= 3 && < 4, unix, regex-compat, time >= 1.1, Unixutils >= 1.10 , mtl, network, HaXml < 1.14, pretty, directory, bytestring, process, containers, old-time, old-locale, QuickCheck < 2, HUnit, random, filepath+Homepage: http://src.seereason.com/ghc6102/haskell-extra/+Build-Depends: base >= 3 && < 4, unix, regex-compat, time >= 1.1, Unixutils >= 1.10 , mtl, network, pretty, directory, bytestring, process, containers, old-time, old-locale, QuickCheck < 2, HUnit, random, filepath Synopsis: A grab bag of modules. ghc-options: -O2 -W C-Sources: cbits/gwinsz.c Include-Dirs: cbits Install-Includes: gwinsz.h Exposed-modules:- Extra.Bool, Extra.Either, Extra.Exit, Extra.Files, Extra.HaXml+ Extra.Bool, Extra.Either, Extra.Exit, Extra.Files, Extra.GPGSign,Extra.List, Extra.HughesPJ, Extra.Lock, Extra.Misc, Extra.Net, Extra.SSH,- Extra.Time, Extra.Terminal, Extra.CIO, Extra.TIO, Extra.IO, Extra.URI, Test.QUnit+ Extra.Time, Extra.Terminal, Extra.CIO, Extra.TIO, Extra.IO, Extra.URI, Test.QUnit, Test.QuickCheck.Properties Build-Type: Simple -- For more complex build options see:
− Extra/HaXml.hs
@@ -1,33 +0,0 @@-module Extra.HaXml where--import Text.PrettyPrint.HughesPJ-import Text.XML.HaXml-import Text.XML.HaXml.Pretty---- ** XML Helper functions (move)--- | Render XML as a string.--- MOVE: ??-showXML :: String -> CFilter -> Doc-showXML styleSheet = document . mkDocument styleSheet . cfilterToElem---- MOVE: ??-mkTxt :: String -> CFilter-mkTxt = cdata---- MOVE: ??--- cliff says this is broken with regards to cdata-cfilterToElem :: CFilter -> Element-cfilterToElem f = case f (CString False "") of- [CElem e] -> xmlEscape stdXmlEscaper e- [] -> error "RSS produced no output"- _ -> error "RSS produced more than one output"---- <?xml-stylesheet type="text/xsl" href="cdcatalog.xsl"?>--- MOVE: ??-mkDocument :: String -> Element -> Document-mkDocument styleSheet elem =- let xmlDecl = XMLDecl "1.0" (Just (EncodingDecl "utf-8")) (Just True)- prolog = Prolog (Just xmlDecl) [] Nothing [PI ("xml-stylesheet","type=\"text/xsl\" href=\""++styleSheet++"\"")]- symTable = []- in- Document prolog [] elem []
Extra/URI.hs view
@@ -68,7 +68,7 @@ -- the URI query. The isUnreserved predicate is the set of characters -- that can appear in a URI which don't have any special meaning. -- Everything else gets escaped.-escapeURIForQueryValue = escapeURIString (not . isUnreserved)+escapeURIForQueryValue = escapeURIString isUnreserved -- Make URI an instance of Read. This will throw an error if no -- prefix up to ten characters long of the argument string looks like
+ Test/QuickCheck/Properties.hs view
@@ -0,0 +1,9 @@+module Test.QuickCheck.Properties where++import Test.QuickCheck++isIdempotentBy :: (Arbitrary a, Eq a, Show a) => (a -> a) -> Gen a -> Property+isIdempotentBy f src = forAll src $ \a -> f a == f (f a)++isIdempotent :: (Arbitrary a, Eq a, Show a) => (a -> a) -> Property+isIdempotent f = isIdempotentBy f arbitrary