summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlpMestanogullari <>2011-08-08 16:25:49 (GMT)
committerLuite Stegeman <luite@luite.com>2011-08-08 16:25:49 (GMT)
commita2479f1f7ce8ab4acf45fd259626969310350664 (patch)
treed8d725f864a9b79e0309cbd558b8171623e152ed
parent592c8d50406169ad66f06d4f0462803408b0a17d (diff)
version 0.1.10.1.1
-rw-r--r--Network/Pastis.hs6
-rw-r--r--pastis.cabal2
2 files changed, 2 insertions, 6 deletions
diff --git a/Network/Pastis.hs b/Network/Pastis.hs
index 45f1aa0..83a2fa9 100644
--- a/Network/Pastis.hs
+++ b/Network/Pastis.hs
@@ -5,11 +5,7 @@ import Network.URI
-- | Use pastisURL to shorten a URL.
pastisURL :: String -> IO String
-pastisURL url = do
- result <- simpleHTTP request `catch` (const . return $ Left undefined)
- case result of
- Left _ -> return url
- Right response -> return $ rspBody response
+pastisURL url = fmap (either (const url) rspBody) (simpleHTTP request) `catch` (return . const url)
where request = Request { rqURI = uri
, rqMethod = GET
, rqHeaders = []
diff --git a/pastis.cabal b/pastis.cabal
index 853bec1..c3b3d59 100644
--- a/pastis.cabal
+++ b/pastis.cabal
@@ -7,7 +7,7 @@ Name: pastis
-- The package version. See the Haskell package versioning policy
-- (http://www.haskell.org/haskellwiki/Package_versioning_policy) for
-- standards guiding when and how versions should be incremented.
-Version: 0.1
+Version: 0.1.1
-- A short (one-line) description of the package.
Synopsis: Interface to the past.is URL shortening service