@@ 97,7 97,21 @@ setReworkNew n =
toRework =
List.map (\x -> updateRework x NeedsRework)
in
- Random.map (\( a, b ) -> toRework a ++ b) << Random.List.choices n
+ Random.map (\( a, b ) -> toRework a ++ b) << choices n
+
+
+choices : Int -> List a -> Random.Generator ( List a, List a )
+choices n xs =
+ case n of
+ 0 ->
+ Random.constant ( [], xs )
+
+ _ ->
+ let
+ xs1 =
+ Random.List.shuffle xs
+ in
+ Random.map2 Tuple.pair (Random.map (List.take n) xs1) (Random.map (List.drop n) xs1)
setReworksCmd : Model -> Cmd Msg