Skip to content

Commit 8d6501b

Browse files
committed
update README.md for "implement Make via tuples"
1 parent 5ca8c03 commit 8d6501b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ stable code, the `rand` machinery likes to know the exact type of the object whi
227227
`rand(m)`, and `maketype(T, args...)` is supposed to return that type. For example,
228228
`maketype(Pair, 1:3, UInt) == Pair{Int,UInt}`.
229229
Then just define `rand` for `m` like documented in the `Random` module, e.g.
230-
`rand(rng::AbstractRNG, sp::SamplerTrivial{<:Make{P}}) where {P<:Pair} = P(rand(sp[].x), rand(sp[].y))`.
230+
`rand(rng::AbstractRNG, sp::SamplerTrivial{<:Make{P}}) where {P<:Pair} = P(rand(sp[][1]), rand(sp[][2]))`.
231231
For convenience, `maketype(T, ...)` defaults to `T`, which means that for simple cases, only the
232232
`rand` function has to be defined. But in cases like for `Pair` above, if `maketype` is not
233233
defined, the generated type will be assumed to be `Pair`, which is not a concrete type

0 commit comments

Comments
 (0)