added how to make bytestring to string example

This commit is contained in:
Jeena Paradies 2014-11-28 13:38:37 +01:00
parent 77f105b0c6
commit 206d0990c9

View file

@ -20,3 +20,15 @@ getTweet url = do
case body of
empty -> return Nothing
_ -> return Just (L.unpack body)
module Main where
import qualified Data.ByteString as BS
import Data.Char
main :: IO ()
main = do
bs <- BS.readFile "haskelltest.hs"
let w8 = BS.unpack bs
putStrLn $ map (chr . fromIntegral) w8