Closed samuelrivas closed 1 year ago
Just in case you need an example, I put one here: https://github.com/haskell-numerics/random-fu/issues/83#issuecomment-1114591775
I think the difference between what :i
returns and :t
returns is a question for ghc.
Great, thanks. I'll take a look.
For the record, I got an answer for the difference between :t
and :i
. In short, :t
runs type inference, and simplifies Sampleable
out with the instance for Distribution
, :i
on the other hand reports the type that is written in the source code, without running inference on it.
I am trying to update some old code that doesn't compile with the latest version of random fu, but I am a bit confused about how is
sample
working now.From the docs and the code I see that its type is so I should be able to sample an RVar having a stateful generator
Which is what
:i
also returns inghci
. However:t
returns a different type, which makes sampling anRVar
a bit more unclear:Can someone explain what is going on here?