File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
src/Distribution/Server/Features Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -42,13 +42,13 @@ import System.FilePath ( isExtensionOf )
4242import qualified System.IO as SIO
4343
4444data Scorer = Scorer
45- { maximum :: Float
45+ { maximumS :: Float
4646 , score :: Float
4747 }
4848 deriving Show
4949
5050instance Semigroup Scorer where
51- (Scorer a b) <> (Scorer c d) = Scorer (a + b ) (c + d)
51+ (Scorer a b) <> (Scorer c d) = Scorer (a + c ) (b + d)
5252
5353scorer :: Float -> Float -> Scorer
5454scorer maxim scr =
@@ -62,7 +62,7 @@ boolScor k True = Scorer k k
6262boolScor k False = Scorer k 0
6363
6464total :: Scorer -> Float
65- total (Scorer a b) = a / b
65+ total (Scorer a b) = b / a
6666
6767major :: Num a => [a ] -> a
6868major (x : _) = x
@@ -257,7 +257,7 @@ rankPackagePage p = tests <> benchs <> desc <> homeP <> sourceRp <> cats
257257 where
258258 tests = boolScor 50 (hasTests p)
259259 benchs = boolScor 10 (hasBenchmarks p)
260- desc = Scorer 30 (min 1 (int2Float (S. length $ description p) / 300 ))
260+ desc = scorer 30 (min 1 (int2Float (S. length $ description p) / 300 ))
261261 -- documentation = boolScor 30 ()
262262 homeP = boolScor 30 (not $ S. null $ homepage p)
263263 sourceRp = boolScor 8 (not $ null $ sourceRepos p)
You can’t perform that action at this time.
0 commit comments