[pure-lang-svn] SF.net SVN: pure-lang:[612] pure/trunk
Status: Beta
Brought to you by:
agraef
|
From: <ag...@us...> - 2008-08-25 23:58:48
|
Revision: 612
http://pure-lang.svn.sourceforge.net/pure-lang/?rev=612&view=rev
Author: agraef
Date: 2008-08-25 23:58:55 +0000 (Mon, 25 Aug 2008)
Log Message:
-----------
Add optimization rules for some combinators.
Modified Paths:
--------------
pure/trunk/ChangeLog
pure/trunk/lib/prelude.pure
Modified: pure/trunk/ChangeLog
===================================================================
--- pure/trunk/ChangeLog 2008-08-25 23:56:04 UTC (rev 611)
+++ pure/trunk/ChangeLog 2008-08-25 23:58:55 UTC (rev 612)
@@ -1,3 +1,8 @@
+2008-08-26 Albert Graef <Dr....@t-...>
+
+ * lib/prelude.pure: Add optimization rules for ($) and (.) so that
+ they are expanded at compile time if possible.
+
2008-08-25 Albert Graef <Dr....@t-...>
* parser.yy, lexer.ll, interpreter.cc: Added macro substitution
Modified: pure/trunk/lib/prelude.pure
===================================================================
--- pure/trunk/lib/prelude.pure 2008-08-25 23:56:04 UTC (rev 611)
+++ pure/trunk/lib/prelude.pure 2008-08-25 23:58:55 UTC (rev 612)
@@ -91,6 +91,12 @@
uncurry3 f (x,y,z)
= f x y z;
+/* Some convenient optimization rules which eliminate saturated calls of the
+ function composition combinators. */
+
+def f $ x = f x;
+def (f . g) x = f (g x);
+
/* "Mapsto" operator. This constructor is declared here so that it can be used
in other standard library modules to denote special kind 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.
|