Re: [Haskell] lazy constructors

2004-10-13 Thread Jeremy Gibbons
On 13 Oct 2004, at 06:59, Serge D. Mechveliani wrote: bottomStr :: String bottomStr = let xs = xs in xs bottomSPair :: (String, String) bottomSPair = let p = p in p Note here that bottomSPair is bottom... addToSPair :: Char -> (String, String) -> (String, String) addToSPairc (xs, ys

Re: [Haskell] lazy constructors

2004-10-13 Thread MR K P SCHUPKE
You can only return a list of pair's lazily, not a pair of lists. If the two strings are independant, then generate each in a separate function, and pair off the results lazily. Keean. ___ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/ma

Re: [Haskell] lazy constructors

2004-10-13 Thread Sander Evers
Question 2 -- How to arrange the above `lazy' output? Your function addToSPair addToSPair :: Char -> (String, String) -> (String, String) addToSPairc (xs, ys) = (c:xs, ys) does a strict pattern match on the pair constructor. It needs to know that its second argu

[Haskell] lazy constructors

2004-10-12 Thread Serge D. Mechveliani
Dear Haskellers, I try to organize a `lazy' output in my program, so that the data are accumulated, step by step in a pair (String, String) (a contrived simplified example). And the first component is a `story' to be printed out in a `lazy' manner, the