Re: [Haskell-cafe] Really need some help understanding a solution

2009-03-30 Thread Peter Verswyvelen
On Sat, Mar 28, 2009 at 3:03 AM, Henning Thielemann lemm...@henning-thielemann.de wrote: What about using a custom list type, that has only one constructor like (:), that is, a type for infinite lists? You mean Data.Stream?http://hackage.haskell.org/cgi-bin/hackage-scripts/package/Stream

Re: [Haskell-cafe] Really need some help understanding a solution

2009-03-27 Thread Henning Thielemann
On Thu, 26 Mar 2009, wren ng thornton wrote: Thomas Hartman wrote: Luke, does your explanation to Guenther have anything to do with coinduction? -- the property that a producer gives a little bit of output at each step of recursion, which a consumer can than crunch in a lazy way? It has

Re: [Haskell-cafe] Really need some help understanding a solution

2009-03-27 Thread Luke Palmer
On Fri, Mar 27, 2009 at 7:03 PM, Henning Thielemann lemm...@henning-thielemann.de wrote: On Thu, 26 Mar 2009, wren ng thornton wrote: Thomas Hartman wrote: Luke, does your explanation to Guenther have anything to do with coinduction? -- the property that a producer gives a little bit of

[Haskell-cafe] Really need some help understanding a solution

2009-03-26 Thread GüŸnther Schmidt
Hi guys, I tried for days now to figure out a solution that Luke Palmer has presented me with, by myself, I'm getting nowhere. He has kindly provided me with this code: import Data.Monoid newtype IntTrie a = IntTrie [a] deriving Show singleton :: (Monoid a) = Int - a - IntTrie a

Re: [Haskell-cafe] Really need some help understanding a solution

2009-03-26 Thread Luke Palmer
On Thu, Mar 26, 2009 at 12:21 PM, GüŸnther Schmidt gue.schm...@web.dewrote: Hi guys, I tried for days now to figure out a solution that Luke Palmer has presented me with, by myself, I'm getting nowhere. Sorry, I meant to respond earlier. They say you don't really understand something until

Re: [Haskell-cafe] Really need some help understanding a solution

2009-03-26 Thread Thomas Hartman
Luke, does your explanation to Guenther have anything to do with coinduction? -- the property that a producer gives a little bit of output at each step of recursion, which a consumer can than crunch in a lazy way? I find that coinduction seems to figure frequently in algos that process a stream.

Re: [Haskell-cafe] Really need some help understanding a solution

2009-03-26 Thread Thomas Hartman
Re that link: search for wren's comments containing it is however nicely coinductive 2009/3/26 Thomas Hartman tphya...@gmail.com: Luke, does your explanation to Guenther have anything to do with coinduction? -- the property that a producer gives a little bit of output at each step of

Re: [Haskell-cafe] Really need some help understanding a solution

2009-03-26 Thread wren ng thornton
Thomas Hartman wrote: Luke, does your explanation to Guenther have anything to do with coinduction? -- the property that a producer gives a little bit of output at each step of recursion, which a consumer can than crunch in a lazy way? It has more to do with tying the knot (using laziness to

Re: [Haskell-cafe] Really need some help understanding a solution

2009-03-26 Thread David Menendez
2009/3/26 Luke Palmer lrpal...@gmail.com: The spine of this trie is maximally lazy: this is key.  If the structure of the spine depended on the input data (as it does for Data.Map), then we wouldn't be able to process infinite data, because we can never get it all. So even making a trie out of