summaryrefslogtreecommitdiff
path: root/Network
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 /Network
parent592c8d50406169ad66f06d4f0462803408b0a17d (diff)
version 0.1.10.1.1
Diffstat (limited to 'Network')
-rw-r--r--Network/Pastis.hs6
1 files changed, 1 insertions, 5 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 = []