-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lab 3 #4
Comments
The line |
The |
I mean: I don't recognise that rule in the mentioned code fragment. I have no problems with |
I actually have a very good reason for this. The thing is: performance. First, I wrote the random generator like this:
However, the usage of unsafe gave issues (of course). So I changed it all to IO datatypes to fix those unsafe related issues:
This worked, only the performance was very very bad (which I could never have known). Large problems completely crashed. So I came up with a solution of not using too much IO (because of the performance issues) by generating all random numbers in advance to the calculcation. However, as I don't know yet between what numbers I want them at that point (could be anything), I create random floats between 0 and 1 which I can later translate to any random number bound I want by using the following functions:
I tried to explain this process using the following comment:
However, as it's quite an extensive process (as you see) concerning several revisions I understand that this might not have been completely clear just based on that comment. |
I understand your point. But the following remark about the performance surprises me. |
Yes, it also surprised me. It is probably because the nested extraction of monads is not very optimized way in haskell. |
Exercise 1
Nice solution with
uncurry
.Exercise 2
equiv
is not sufficient. Required is: That the forms have the same shape. SoExercise 3
The following rule is too complicated. I don't recognize the rule
-- p ∨ (q ∧ r) == (p ∨ q) ∧ (p ∨ r)
in the following fragmentSimpler solution:
Exercise 4
Why not
? Floats occur nowhere.
The text was updated successfully, but these errors were encountered: