@@ -206,8 +206,10 @@ rand(rng::AbstractRNG, sp::SamplerTag{Cont{T}}) where {T<:Union{Pair,Complex}} =
206
206
# ### additional convenience methods
207
207
208
208
# rand(Pair{A,B}) => rand(make(Pair{A,B}, A, B))
209
- Sampler (:: Type{RNG} , :: Type{Pair{A,B}} , n:: Repetition ) where {RNG<: AbstractRNG ,A,B} =
210
- Sampler (RNG, make (Pair{A,B}, A, B), n)
209
+ if VERSION < v " 1.11.0-DEV.618" # now implemented in `Random`
210
+ Sampler (:: Type{RNG} , :: Type{Pair{A,B}} , n:: Repetition ) where {RNG<: AbstractRNG ,A,B} =
211
+ Sampler (RNG, make (Pair{A,B}, A, B), n)
212
+ end
211
213
212
214
# rand(make(Complex, x)) => rand(make(Complex, x, x))
213
215
Sampler (:: Type{RNG} , u:: Make1{T} , n:: Repetition ) where {RNG<: AbstractRNG ,T<: Complex } =
@@ -226,6 +228,17 @@ Sampler(::Type{RNG}, ::Type{T}, n::Repetition
226
228
) where {RNG<: AbstractRNG ,T<: Union{Tuple,NamedTuple} } =
227
229
Sampler (RNG, make (T), n)
228
230
231
+ if VERSION >= v " 1.11.0-DEV.573"
232
+ # now `Random` implements `rand(Tuple{...})`, so be more specific for
233
+ # special stuff still not implemented by `Random`
234
+ # TODO : we should probably remove this
235
+ Sampler (:: Type{RNG} , :: Type{Tuple} , n:: Repetition ) where {RNG <: AbstractRNG } =
236
+ Sampler (RNG, make (Tuple), n)
237
+
238
+ Sampler (:: Type{RNG} , :: Type{NTuple{N}} , n:: Repetition ) where {RNG <: AbstractRNG , N} =
239
+ Sampler (RNG, make (NTuple{N}), n)
240
+ end
241
+
229
242
# ### make
230
243
231
244
# implement make(Tuple, S1, S2...), e.g. for rand(make(Tuple, Int, 1:3)),
0 commit comments