From 30e6f08e27a915669727a84bb745a956e69eb796 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20P=C3=A4tzel?= Date: Sat, 2 May 2020 16:13:18 +0200 Subject: [PATCH] Improve a few doc comments --- src/GA.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/GA.hs b/src/GA.hs index cf6d487..d9e1033 100644 --- a/src/GA.hs +++ b/src/GA.hs @@ -138,7 +138,7 @@ children2 nX i1 i2 = do return $ i5 :| [i6] {-| -The best according to a function, return up to @k@ results and the remaining +The best according to a function; returns up to @k@ results and the remaining population. If @k <= 0@, this returns the best one anyway (as if @k == 1@). @@ -183,13 +183,13 @@ prop_bestsBy_lengths k pop = $ length bests == min k (length pop) && length bests + length rest == length pop {-| -The @k@ worst individuals in the population. +The @k@ worst individuals in the population (and the rest of the population). -} worst :: (Individual i, Monad m) => N -> Population i -> m (NonEmpty i, [i]) worst = flip bestsBy (fmap negate . fitness) {-| -The @k@ best individuals in the population. +The @k@ best individuals in the population (and the rest of the population). -} bests :: (Individual i, Monad m) => N -> Population i -> m (NonEmpty i, [i]) bests = flip bestsBy fitness