I am writing this after a good study of disappointment, and I hope that someone here can tell me about the topic.
I want to create a prime random number in the haskell function, but, alas, it is impossible to do without any non-trivial elements like Monads, asignation in the "do", creating generators, etc.
Ideally, I was looking for the equivalent of C "rand ()". But after a long search, I am quite sure that there is no such thing, because of how the language is developed. (If there is, please someone enlighten me). Since this is not possible, I would like to find a way to get a random number for my specific problem and a general explanation of how this works to get a random number.
prefixGenerator :: (Ord a, Arbitrary a) => Gen ([a],[a])
prefixGenerator = frequency [
(1, return ([],[])),
(2, do {
xs1 <- orderedListEj13 ;
xs2 <- orderedListEj13 ;
return (xs1,xs2)
}),
(2, do {
xs2 <- orderedListEj13 ;
return ((take RANDOMNUMBERHERE xs2),xs2)
})
]
QuickCheck, . - this ( drawInt 0 ( xs2) RANDOMNUMBERHERE), , Int IO Int, Int this.