From 40ee14bc952c808cce5e627a7d94600d7335de11 Mon Sep 17 00:00:00 2001
From: Iustin Pop <iustin@google.com>
Date: Thu, 20 Jan 2011 15:42:55 +0100
Subject: [PATCH] Cluster.hs: add a new type alias

Just a bit of small cleanup, since we might want to use more functions
with this signature in the future.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
---
 Ganeti/HTools/Cluster.hs | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/Ganeti/HTools/Cluster.hs b/Ganeti/HTools/Cluster.hs
index e5050e378..48a0cc827 100644
--- a/Ganeti/HTools/Cluster.hs
+++ b/Ganeti/HTools/Cluster.hs
@@ -99,6 +99,10 @@ data AllocSolution = AllocSolution
   , asLog       :: [String]            -- ^ A list of informational messages
   }
 
+-- | Allocation results, as used in 'iterateAlloc' and 'tieredAlloc'.
+type AllocResult = (FailStats, Node.List, Instance.List,
+                    [Instance.Instance], [CStats])
+
 -- | The empty solution we start with when computing allocations
 emptySolution :: AllocSolution
 emptySolution = AllocSolution { asFailures = [], asAllocs = 0
@@ -823,8 +827,7 @@ iterateAlloc :: Node.List
              -> Int
              -> [Instance.Instance]
              -> [CStats]
-             -> Result (FailStats, Node.List, Instance.List,
-                        [Instance.Instance], [CStats])
+             -> Result AllocResult
 iterateAlloc nl il newinst nreq ixes cstats =
       let depth = length ixes
           newname = printf "new-%d" depth::String
@@ -849,8 +852,7 @@ tieredAlloc :: Node.List
             -> Int
             -> [Instance.Instance]
             -> [CStats]
-            -> Result (FailStats, Node.List, Instance.List,
-                       [Instance.Instance], [CStats])
+            -> Result AllocResult
 tieredAlloc nl il newinst nreq ixes cstats =
     case iterateAlloc nl il newinst nreq ixes cstats of
       Bad s -> Bad s
-- 
GitLab