cats-effect icon indicating copy to clipboard operation
cats-effect copied to clipboard

adds more details to random.md documentation

Open wonk1132 opened this issue 2 years ago • 4 comments

Adds more detailed documentation for the Random type, including a unit test example.

wonk1132 avatar Aug 24 '23 23:08 wonk1132

Looks like the build failures are legitimate

djspiewak avatar Sep 26 '23 00:09 djspiewak

sorry, I don't get what I need to do to fix this issue. Can someone point me the right direction?

wonk1132 avatar Oct 14 '23 18:10 wonk1132

Looks like import errors. Use ._ instead of .*. Also cats.implicits is legacy, use cats.syntax.all.

Do you know how to run it locally? docs/mdoc in sbt console. Then you can see and fix the errors before you push.

Thanks for your work!

armanbilge avatar Oct 14 '23 18:10 armanbilge

I feel we should retain the example of using Random in the dieRoll generic function in https://typelevel.org/cats-effect/docs/std/random#using-random

def dieRoll[F[_]: Functor: Random]: F[Int] =
  Random[F].betweenInt(0, 6).map(_ + 1) 

I would like to expand this example into a working copy-and-paste example. This example at current state does not show how dieRoll is used together with an implicit Random instance. Thank you

sshark avatar Mar 06 '24 16:03 sshark