Commit 40ee14bc authored by Iustin Pop's avatar Iustin Pop
Browse files

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: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
parent 3986684e
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment