random
object random
- Source:
- random.scala
Type members
Classlikes
Implicits
Implicits
(`a₂`:A)
caseDiscrete(elts)=>
val`weight₂`:Double=rng.nextDouble()
$anon.this.pick[A](0.0,`weight₂`,elts)
caseRInt=>
rng.nextInt().$asInstanceOf$[A]
caseNatural(u)=>
rng.nextInt(u).$asInstanceOf$[A]
caseRDouble=>
rng.nextDouble().$asInstanceOf$[A]
caseNormal=>
rng.nextGaussian().$asInstanceOf$[A]
}
overridedefmap[A,B](`fa₂`:RandomOp[A])(`f₂`:Function1[A,B]):RandomOp[B]=Always.apply[B](`f₂`.apply($anon.this.extract[A](`fa₂`)))
}
(new$anon():Comonad[[A>:Nothing<:Any]=>RandomOp[A]])
}" class="documentableAnchor">
implicit def
(`a₂`:A)
caseDiscrete(elts)=>
val`weight₂`:Double=rng.nextDouble()
$anon.this.pick[A](0.0,`weight₂`,elts)
caseRInt=>
rng.nextInt().$asInstanceOf$[A]
caseNatural(u)=>
rng.nextInt(u).$asInstanceOf$[A]
caseRDouble=>
rng.nextDouble().$asInstanceOf$[A]
caseNormal=>
rng.nextGaussian().$asInstanceOf$[A]
}
overridedefmap[A,B](`fa₂`:RandomOp[A])(`f₂`:Function1[A,B]):RandomOp[B]=Always.apply[B](`f₂`.apply($anon.this.extract[A](`fa₂`)))
}
(new$anon():Comonad[[A>:Nothing<:Any]=>RandomOp[A]])
}" class="documentableName ">randomInstances(implicit rng: Random): Comonad[RandomOp]
- Source:
- random.scala