[pure-lang-svn] SF.net SVN: pure-lang:[656] pure/trunk/lib/prelude.pure
Status: Beta
Brought to you by:
agraef
From: <ag...@us...> - 2008-08-29 09:31:33
|
Revision: 656 http://pure-lang.svn.sourceforge.net/pure-lang/?rev=656&view=rev Author: agraef Date: 2008-08-29 09:31:43 +0000 (Fri, 29 Aug 2008) Log Message: ----------- Add a void-catmap macro rule to optimize the case of list comprehensions with throwaway results. Modified Paths: -------------- pure/trunk/lib/prelude.pure Modified: pure/trunk/lib/prelude.pure =================================================================== --- pure/trunk/lib/prelude.pure 2008-08-28 15:24:05 UTC (rev 655) +++ pure/trunk/lib/prelude.pure 2008-08-29 09:31:43 UTC (rev 656) @@ -97,6 +97,12 @@ def f $ x = f x; def (f . g) x = f (g x); +/* The following rule is always valid and optimizes the case of list + comprehensions with throwaway results (useful if a list comprehension is + evaluated solely for its side effects). */ + +def void (catmap f x) = do f x; + /* "Mapsto" operator. This constructor is declared here so that it can be used in other standard library modules to denote special kinds of pairs which map keys to values. Here we only define equality of such pairs. */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |