Skip to content

Commit

Permalink
Fix missing signature of shuf
Browse files Browse the repository at this point in the history
  • Loading branch information
cblp committed Aug 14, 2019
1 parent 633392e commit f0e037b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ff-core/lib/FF.hs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import Control.Arrow ((&&&))
import Control.Monad (unless, void, when)
import Control.Monad.Except (throwError)
import Control.Monad.IO.Class (MonadIO, liftIO)
import Control.Monad.State.Strict (evalState, state)
import Control.Monad.State.Strict (MonadState, evalState, state)
import Data.Bool (bool)
import Data.Foldable (asum, for_, toList)
import Data.HashMap.Strict (HashMap)
Expand Down Expand Up @@ -250,6 +250,7 @@ getWikiSamplesWith predicate archive ConfigUI {shuffle} limit today =
shuffleItems :: StdGen -> [b] -> [b]
shuffleItems gen = (`evalState` gen) . shuf

shuf :: MonadState StdGen m => [b] -> m [b]
shuf xs = do
g <- state split
pure . map snd . sortOn fst $ zip (randoms g :: [Int]) xs
Expand Down

0 comments on commit f0e037b

Please sign in to comment.