From e88812b76a14bc47c296fda86709ae5a631a6240 Mon Sep 17 00:00:00 2001
From: Slava Pestov <slava@slava-pestovs-macbook-pro.local>
Date: Mon, 2 Feb 2009 06:04:29 -0600
Subject: [PATCH] map infimum => [ min ] map-reduce

---
 basis/compiler/tree/normalization/normalization.factor | 4 ++--
 extra/project-euler/044/044.factor                     | 5 +++--
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/basis/compiler/tree/normalization/normalization.factor b/basis/compiler/tree/normalization/normalization.factor
index 3f1e9e2667..ee7bf8672e 100644
--- a/basis/compiler/tree/normalization/normalization.factor
+++ b/basis/compiler/tree/normalization/normalization.factor
@@ -1,6 +1,6 @@
 ! Copyright (C) 2008 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: fry namespaces sequences math accessors kernel arrays
+USING: fry namespaces sequences math math.order accessors kernel arrays
 combinators compiler.utilities assocs
 stack-checker.backend
 stack-checker.branches
@@ -54,7 +54,7 @@ M: #branch normalize*
         ] map unzip swap
     ] change-children swap
     [ remaining-introductions set ]
-    [ [ length ] map infimum introduction-stack [ swap head ] change ]
+    [ [ length ] [ min ] map-reduce introduction-stack [ swap head ] change ]
     bi ;
 
 : eliminate-phi-introductions ( introductions seq terminated -- seq' )
diff --git a/extra/project-euler/044/044.factor b/extra/project-euler/044/044.factor
index e7b1959023..46b20253ee 100644
--- a/extra/project-euler/044/044.factor
+++ b/extra/project-euler/044/044.factor
@@ -1,6 +1,7 @@
 ! Copyright (c) 2008 Aaron Schaefer.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: kernel math math.functions math.ranges project-euler.common sequences ;
+USING: kernel math math.functions math.ranges math.order
+project-euler.common sequences ;
 IN: project-euler.044
 
 ! http://projecteuler.net/index.php?section=problems&id=44
@@ -37,7 +38,7 @@ PRIVATE>
 
 : euler044 ( -- answer )
     2500 [1,b] [ nth-pentagonal ] map dup cartesian-product
-    [ first2 sum-and-diff? ] filter [ first2 - abs ] map infimum ;
+    [ first2 sum-and-diff? ] filter [ first2 - abs ] [ min ] map-reduce ;
 
 ! [ euler044 ] 10 ave-time
 ! 4996 ms ave run time - 87.46 SD (10 trials)