...but the compilation fails miserably with:
• Ambiguous type variable ‘e0’ arising from a use of ‘runCRand’
prevents the constraint ‘(ContainsGenError e0)’ from being solved.
Relevant bindings include
impl :: CRandT
SystemRandom e0 Data.Functor.Identity.Identity UUID.UUID
(bound at src/Party.hs:75:9)
Probable fix: use a type annotation to specify what ‘e0’ should be.
These potential instance exist:
instance ContainsGenError GenError
-- Defined in ‘Control.Monad.CryptoRandom’
• In the expression: runCRand impl g
In a stmt of a 'do' block:
case runCRand impl g of {
Left err -> throwIO err
Right (v, g') -> return v }
In the expression:
do { g <- newGenIO :: IO SystemRandom;
case runCRand impl g of {
Left err -> throwIO err
Right (v, g') -> return v } }
...
What's the problem here?
Are there some good examples for generating crypto-randoms?