[pure-lang-svn] SF.net SVN: pure-lang: [276] pure/trunk
Status: Beta
Brought to you by:
agraef
From: <ag...@us...> - 2008-06-22 08:09:24
|
Revision: 276 http://pure-lang.svn.sourceforge.net/pure-lang/?rev=276&view=rev Author: agraef Date: 2008-06-21 06:18:27 -0700 (Sat, 21 Jun 2008) Log Message: ----------- Fix a glitch in the definition of foldr1 which caused list elements to be processed in the wrong order. Modified Paths: -------------- pure/trunk/ChangeLog pure/trunk/lib/prelude.pure Modified: pure/trunk/ChangeLog =================================================================== --- pure/trunk/ChangeLog 2008-06-21 11:13:10 UTC (rev 275) +++ pure/trunk/ChangeLog 2008-06-21 13:18:27 UTC (rev 276) @@ -1,3 +1,8 @@ +2008-06-21 Albert Graef <Dr....@t-...> + + * lib/prelude.pure: Fixed a glitch in the definition of foldr1 + which caused list elements to be processed in the wrong order. + 2008-06-20 Albert Graef <Dr....@t-...> * 0.4 release. Modified: pure/trunk/lib/prelude.pure =================================================================== --- pure/trunk/lib/prelude.pure 2008-06-21 11:13:10 UTC (rev 275) +++ pure/trunk/lib/prelude.pure 2008-06-21 13:18:27 UTC (rev 276) @@ -252,7 +252,7 @@ = f x (foldl (flip f) a (reverse xs)); foldr1 f [x] = x; -foldr1 f (x:xs) = foldr f x xs; +foldr1 f (x:xs) = f x (foldl1 (flip f) (reverse xs)); head (x:xs) = x; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |