Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanknowles committed Jul 27, 2021
1 parent 9f0f334 commit a6b2303
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,11 @@ selectCollateral params
$ L.sortOn F.fold validCombinations
where
validCombinations :: [Map inputId Coin]
validCombinations = mapMaybe smallestValidCombinationForSize
validCombinations = mapMaybe smallestValidCombinationOfSize
[1 .. maximumCollateralEntryCount]

smallestValidCombinationForSize :: Int -> Maybe (Map inputId Coin)
smallestValidCombinationForSize size = coinsAvailable
smallestValidCombinationOfSize :: Int -> Maybe (Map inputId Coin)
smallestValidCombinationOfSize size = coinsAvailable
& Map.toList
& (`subsequencesOfSize` size)
& fmap (\ics -> (ics, F.foldMap snd ics))
Expand All @@ -115,7 +115,7 @@ selectCollateral params
} = params

--------------------------------------------------------------------------------
-- Utility functions
-- Subsequences
--------------------------------------------------------------------------------

numberOfSubsequencesOfSize :: Int -> Int -> Int
Expand Down

0 comments on commit a6b2303

Please sign in to comment.