summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordefanor <defanor@uberspace.net>2019-02-03 23:06:48 +0300
committerdefanor <defanor@uberspace.net>2019-02-03 23:06:48 +0300
commitd10783ddb88a6958009b377f07c3d0dde0087836 (patch)
tree03f45513f61b26a0d09fe9ce081fdcb4734b3a95
parentd032cdc98f1c05306cdab9cff41362db2e6bfa06 (diff)
downloadpgxhtml-d10783ddb88a6958009b377f07c3d0dde0087836.zip
pgxhtml-d10783ddb88a6958009b377f07c3d0dde0087836.tar.gz
pgxhtml-d10783ddb88a6958009b377f07c3d0dde0087836.tar.bz2
Lint, clean up dependencies
-rw-r--r--Main.hs10
-rw-r--r--pgxhtml.cabal2
2 files changed, 5 insertions, 7 deletions
diff --git a/Main.hs b/Main.hs
index 48f2d85..bfee6f3 100644
--- a/Main.hs
+++ b/Main.hs
@@ -108,10 +108,10 @@ transform docBS baseStr pathStr stringParams =
bracket (notNull $ xsltParseStylesheetFile pathCStr) xsltFreeStylesheet $ \stylesheet ->
bracket (notNull $ xsltNewTransformContext stylesheet doc) xsltFreeTransformContext $
\tc -> xsltQuoteUserParams tc paramsArr >>
- (bracket (notNull $ xsltApplyStylesheetUser stylesheet doc emptyArr nullPtr nullPtr tc)
- xmlFreeDoc $ \res ->
- xsltSaveResultToString bufPtr lenPtr res stylesheet >>
- bracket (peek bufPtr) free BS.packCString)
+ bracket (notNull $ xsltApplyStylesheetUser stylesheet doc emptyArr nullPtr nullPtr tc)
+ xmlFreeDoc (\res ->
+ xsltSaveResultToString bufPtr lenPtr res stylesheet >>
+ bracket (peek bufPtr) free BS.packCString)
where
notNull :: IO (Ptr a) -> IO (Ptr a)
notNull a = a >>= \p -> if p == nullPtr
@@ -203,7 +203,7 @@ errorXML (EQuery (QueryError m (PT.Query q))) =
errorXML (EFormat (FormatError m (PT.Query q) p)) =
mkError "format_error" $ [("message", BS.pack m), ("query", q)]
++ map ((,) "param") p
-errorXML (ESQL e) = mkError "sql_error" $
+errorXML (ESQL e) = mkError "sql_error"
[ ("state", sqlState e)
, ("status", BS.pack $ show $ sqlExecStatus e)
, ("message", sqlErrorMsg e)
diff --git a/pgxhtml.cabal b/pgxhtml.cabal
index 3d8c94b..7d64932 100644
--- a/pgxhtml.cabal
+++ b/pgxhtml.cabal
@@ -18,7 +18,6 @@ executable pgxhtml
other-extensions: OverloadedStrings
build-depends: base >=4.9 && <5
, bytestring >=0.10 && <0.11
- , containers >=0.5 && <0.6
, envy >=1.5 && <1.6
, filepath >=1.4 && <1.5
, http-api-data >=0.3 && <0.4
@@ -31,7 +30,6 @@ executable pgxhtml
, wai >=3.2 && <3.3
, wai-extra >=3.0 && <3.1
, wai-handler-fastcgi >= 3.0.0.2
- , warp >=3.2 && <3.3
default-language: Haskell2010
pkgconfig-depends: libxml-2.0, libxslt, libexslt
ghc-options: -Wall