Re: [Haskell-cafe] Using ShowS or Difference Lists

2010-02-08 Thread Bas van Dijk
On Sat, Feb 6, 2010 at 1:42 PM, Mark Spezzano mark.spezz...@chariot.net.au wrote: Just wondering whether I can use ShowS or tupling or Difference Lists to speed up the following code?... In case you do want to use a difference list, you could also use a DString[1]. A DString is just a newtype

Re: [Haskell-cafe] Using ShowS or Difference Lists

2010-02-07 Thread Holger Siegel
Am Samstag, den 06.02.2010, 10:28 -0800 schrieb Ryan Ingram: As other people have mentioned, you are duplicating library functionality. But nobody has actually talked about the performance characteristics of your code. Fortunately for you, the calls to (++) in your recursion are

[Haskell-cafe] Using ShowS or Difference Lists

2010-02-06 Thread Mark Spezzano
Hi, Just wondering whether I can use ShowS or tupling or Difference Lists to speed up the following code? It's basic text processing. It takes in a list of Lines where each Line is a list of Words and intersperses between them then concatenates them into a longer String. Note that there is

Re: [Haskell-cafe] Using ShowS or Difference Lists

2010-02-06 Thread Holger Siegel
Am Samstag, den 06.02.2010, 23:12 +1030 schrieb Mark Spezzano: Hi, Just wondering whether I can use ShowS or tupling or Difference Lists to speed up the following code? It's basic text processing. It takes in a list of Lines where each Line is a list of Words and intersperses between

Re: [Haskell-cafe] Using ShowS or Difference Lists

2010-02-06 Thread Felipe Lessa
On Sat, Feb 06, 2010 at 11:12:40PM +1030, Mark Spezzano wrote: -- Function: joinLines -- Joins the Words within Lines together with whitespace and newline characters -- Argument: Lines to pad with whitespace and newlines -- Evaluate: The processed and concatenated String joinLines :: [Line]

Re: [Haskell-cafe] Using ShowS or Difference Lists

2010-02-06 Thread Daniel Fischer
Am Samstag 06 Februar 2010 13:42:40 schrieb Mark Spezzano: Hi, Just wondering whether I can use ShowS or tupling or Difference Lists to speed up the following code? It's basic text processing. It takes in a list of Lines where each Line is a list of Words and intersperses between them

Re: [Haskell-cafe] Using ShowS or Difference Lists

2010-02-06 Thread Ryan Ingram
As other people have mentioned, you are duplicating library functionality. But nobody has actually talked about the performance characteristics of your code. Fortunately for you, the calls to (++) in your recursion are right-associative, so you don't have an asymptotic problem where your program