Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Simple UTF-8 decoding.

  • Loading branch information...
commit 38c807f6c5f70c358e5ea2fe023e4bb0d0b64a9a 1 parent 888b050
Bryan O'Sullivan authored
Showing with 10 additions and 2 deletions.
  1. +7 −1 src/Download.hs
  2. +3 −1 strange-loop-2011.cabal
8 src/Download.hs
View
@@ -1,5 +1,11 @@
module Download where
+import Data.ByteString.Lazy
+import Data.Text.Lazy
+import Data.Text.Lazy.Encoding
import Network.HTTP.Enumerator
-download url = simpleHttp url
+download :: String -> IO Text
+download url = do
+ page <- simpleHttp url
+ return (decodeUtf8 page)
4 strange-loop-2011.cabal
View
@@ -9,4 +9,6 @@ executable strange-loop
build-depends:
base,
- http-enumerator
+ bytestring,
+ http-enumerator,
+ text
Please sign in to comment.
Something went wrong with that request. Please try again.