Skip to content

Commit

Permalink
tailrec
Browse files Browse the repository at this point in the history
  • Loading branch information
0x53A committed Apr 28, 2017
1 parent 56c53a9 commit 4bab73c
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/Paket.Core/PackageResolver.fs
Original file line number Diff line number Diff line change
Expand Up @@ -654,6 +654,8 @@ let Resolve (getVersionsF, getPackageDetailsF, groupName:GroupName, globalStrate

let rec step (stage:Stage) (stackpack:StackPack) compatibleVersions (flags:StepFlags) =

//printfn "--step-- %A-%A-%A-%A" stage stackpack compatibleVersions flags

let inline fuseConflicts currentConflict priorConflictSteps =
match currentConflict, priorConflictSteps with
| currentConflict, (lastConflict,lastStep,lastRequirement,lastCompatibleVersions,lastFlags)::priorConflictSteps ->
Expand All @@ -662,6 +664,22 @@ let Resolve (getVersionsF, getPackageDetailsF, groupName:GroupName, globalStrate
step (Inner((continueConflict,lastStep,lastRequirement),priorConflictSteps)) stackpack lastCompatibleVersions lastFlags
| currentConflict, [] -> currentConflict

//let fuseConflicts currentConflict priorConflictSteps =
// let lastRelevantStep =
// priorConflictSteps
// |> Seq.tryFind
// match currentConflict, priorConflictSteps with
// | currentConflict, [] -> currentConflict
// | currentConflict, priorConflictSteps ->
// let lastRelevantStep, priorConflictSteps =
// priorConflictSteps
// |> Seq.fi
// let (lastConflict,lastStep,lastRequirement,lastCompatibleVersions,lastFlags) = lastRelevantStep
// let continueConflict =
// { currentConflict with VersionsToExplore = lastConflict.VersionsToExplore }
// step (Inner((continueConflict,lastStep,lastRequirement),priorConflictSteps)) stackpack lastCompatibleVersions lastFlags

//let x =
match stage with
| Step((currentConflict,currentStep,_currentRequirement), priorConflictSteps) ->
if Set.isEmpty currentStep.OpenRequirements then
Expand Down Expand Up @@ -813,6 +831,8 @@ let Resolve (getVersionsF, getPackageDetailsF, groupName:GroupName, globalStrate
Environment.NewLine currentRequirement Environment.NewLine nextStep.OpenRequirements
step (Step((currentConflict,nextStep,currentRequirement), (currentConflict,currentStep,currentRequirement,compatibleVersions,flags)::priorConflictSteps)) stackpack currentConflict.VersionsToExplore flags

//x


let startingStep = {
Relax = false
Expand Down

0 comments on commit 4bab73c

Please sign in to comment.