[Haskell-cafe] String vs ByteString

2010-08-13 Thread Erik de Castro Lopo
Hi all, I'm using Tagsoup to strip data out of some rather large XML files. Since the files are large I'm using ByteString, but that leads me to wonder what is the best way to handle clashes between Prelude functions like putStrLn and the ByteString versions? Anyone have any suggestions for

Re: [Haskell-cafe] String vs ByteString

2010-08-13 Thread Michael Snoyman
Just import the ByteString module qualified. In other words: import qualified Data.ByteString as S or for lazy bytestrings: import qualified Data.ByteString.Lazy as L Cheers, Michael On Fri, Aug 13, 2010 at 2:32 PM, Erik de Castro Lopo mle...@mega-nerd.commle%2...@mega-nerd.com wrote: Hi

Re: [Haskell-cafe] String vs ByteString

2010-08-13 Thread Johan Tibell
Hi Erik, On Fri, Aug 13, 2010 at 1:32 PM, Erik de Castro Lopo mle...@mega-nerd.commle%2...@mega-nerd.com wrote: Since the files are large I'm using ByteString, but that leads me to wonder what is the best way to handle clashes between Prelude functions like putStrLn and the ByteString

Re: [Haskell-cafe] String vs ByteString

2010-08-13 Thread Michael Snoyman
On Fri, Aug 13, 2010 at 2:42 PM, Johan Tibell johan.tib...@gmail.comwrote: Hi Erik, On Fri, Aug 13, 2010 at 1:32 PM, Erik de Castro Lopo mle...@mega-nerd.commle%2...@mega-nerd.com wrote: Since the files are large I'm using ByteString, but that leads me to wonder what is the best way to

Re: [Haskell-cafe] String vs ByteString

2010-08-13 Thread Johan Tibell
On Fri, Aug 13, 2010 at 1:47 PM, Michael Snoyman mich...@snoyman.comwrote: Use qualified imports, like so: import qualified Data.ByteString as B main = B.putStrLn $ B.pack test If you want to pack a String into a ByteString, you'll need to import Data.ByteString.Char8 instead. Very

Re: [Haskell-cafe] String vs ByteString

2010-08-13 Thread Pierre-Etienne Meunier
Hi, Why don't you use the Data.Rope library ? The asymptotic complexities are way better than those of the ByteString functions. PE El 13/08/2010, a las 07:32, Erik de Castro Lopo escribió: Hi all, I'm using Tagsoup to strip data out of some rather large XML files. Since the files are

Re: [Haskell-cafe] String vs ByteString

2010-08-13 Thread Johan Tibell
On Fri, Aug 13, 2010 at 4:03 PM, Pierre-Etienne Meunier pierreetienne.meun...@gmail.com wrote: Hi, Why don't you use the Data.Rope library ? The asymptotic complexities are way better than those of the ByteString functions. PE For some operations. I'd expect it to be a constant factor

Re: [Haskell-cafe] String vs ByteString

2010-08-13 Thread Erik de Castro Lopo
Pierre-Etienne Meunier wrote: Hi, Why don't you use the Data.Rope library ? The asymptotic complexities are way better than those of the ByteString functions. What I see as my current problem is that there is already a problem having two things Sting and ByteString which represent strings.