@@ -1317,13 +1317,35 @@ normal_s(Mean, Variance, State0) when 0 =< Variance ->
13171317 {Mean + (math :sqrt (Variance ) * X ), State }.
13181318
13191319
1320- -spec shuffle (list ()) -> list ().
1320+ -doc """
1321+ Shuffle a list.
1322+
1323+ Like `shuffle_s/2` but operates on the state stored in
1324+ the process dictionary. Returns the shuffled list.
1325+ """ .
1326+ -doc (#{group => <<" Plug-in framework API" >>,since => <<" OTP 29.0" >>}).
1327+ -spec shuffle (List :: list ()) -> ShuffledList :: list ().
13211328shuffle (List ) ->
13221329 {ShuffledList , State } = shuffle_s (List , seed_get ()),
13231330 _ = seed_put (State ),
13241331 ShuffledList .
13251332
1326- -spec shuffle_s (list (), state ()) -> {list (), state ()}.
1333+ -doc """
1334+ Shuffle a list.
1335+
1336+ From the specified `State` shuffles a list
1337+ so that every element in `List` has an equal probability
1338+ to be shuffled into every position in `ShuffledList`.
1339+
1340+ Returns the shuffled list [`ShuffledList`](`t:list/0`)
1341+ and the [`NewState`](`t:state/0`).
1342+ """ .
1343+ -doc (#{group => <<" Plug-in framework API" >>,since => <<" OTP 29.0" >>}).
1344+ -spec shuffle_s (List , State ) ->
1345+ {ShuffledList :: list (), NewState :: state ()}
1346+ when
1347+ List :: list (),
1348+ State :: state ().
13271349shuffle_s (List , {#{bits := _ , next := Next } = AlgHandler , R0 })
13281350 when is_list (List ) ->
13291351 WeakLowBits = maps :get (weak_low_bits , AlgHandler , 0 ),
0 commit comments