[Haskell-cafe] can't find in hayoo

Roderick Ford developer at live.com
Wed Sep 29 12:58:16 EDT 2010


YES!! Thank you so much.  

And thanks to Thomas also for the suggestion of using Data.ByteString.Base64 ... as the alternative method.

 

Cheers,

Roderick
 
> Date: Wed, 29 Sep 2010 11:11:01 -0500
> Subject: Re: [Haskell-cafe] can't find in hayoo
> From: aslatter at gmail.com
> To: developer at live.com
> CC: haskell-cafe at haskell.org
> 
> On Wed, Sep 29, 2010 at 11:03 AM, Roderick Ford <developer at live.com> wrote:
> > I need the trick to get from
> > ByteString -> [GHC.Word.Word8]
> > and Hayoo is not helping.
> >
> > Super simple I expected.  I haven't even tried to compile it yet.
> > I am just trying to read in the bytes and encode with base64:
> >
> > import Codec.Binary.Base64
> > import Data.ByteString
> > import System.Directory
> > import System.Environment
> > main :: do
> >         args <- getArgs
> >         bFileExist <- System.Directory.doesFileExist (args !! 0)
> >         let bytedata = --ByteString -> [GHC.Word.Word8]
> >         if bFileExist then putStrLn $ Codec.Binary.Base64.encode bytedata
> >         else putStrlLn ("File does not exist: " ++ (args !! 0))
> >         return ()
> >
> 
> Does 'unpack' do what you want?
> 
> Antoine
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20100929/9921fb3a/attachment.html


More information about the Haskell-Cafe mailing list