I have little experience using Haskell outside of Tidal, so this question might be a bit silly.
I'm trying to sample from an exponential probability distribution using its quantile function:
rexp :: Pattern Double -> Pattern Double rexp lambda = log (1 - p) / lambda * (-1) where p = rand
p must be a random number between 0 and 1, hence
p = rand.
However, if I run
d1 $ slow (rexp 1) $ s "bd"
I get the error
Couldn't match type 'Double' with 'Ratio Integer'. I have tried changing the input-output types, but still ran into issues.
How can I solve this? Is there a better way to achieve what I want?