Re: efficiency question

2002-02-09 Thread Jorge Adriano

On Saturday 09 February 2002 11:38, Jorge Adriano wrote:
 If you make it strict on the (,), like:
  test3 l =
      let s = foldr (\x (a,b) - ((,)$!x+a)$!x-b) (1,1) l
      in  s

 Things will get worst.
 Well, that's what I expected, the elements of the list will b reduced to
 head normal form, and instead of a suspension of (%), you'll have a
 suspension of sums in the fst element of the pair *and* a suspension of
 differences in the second element of the pair.

Eh... no need to comment on this one... this was kind of dumb. Forget it...
:-)

J.A.
___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe



(no subject)

2002-02-09 Thread Phil Haymen

hi,I have a function, using list comprehension to pick
out the head and last elements from a list of lists
and output this into a list without duplicates. It
doesn't work. I want to know what is the error. 

function :: [[Int]] - [Int] 
function seg = nub (concat([head s, last s | s -
seg])  

__
Do You Yahoo!?
Send FREE Valentine eCards with Yahoo! Greetings!
http://greetings.yahoo.com
___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe