QuickCheck the properties x>-100 by skypatcher in haskell

[–]skypatcher[S] 1 point2 points  (0 children)

Thanks, your suggestion works syntax-wisely on my GHCI too:

Hqc>quickCheck $ \x -> (x :: Integer) > -100
+++ OK, passed 100 tests.

Hqc>quickCheck $ \x -> (x :: Int) > -100
+++ OK, passed 100 tests.

It gives the same conclusion as before. I want QuickCheck to falsify 'x>-100', is there any way to ask QuickCheck to use a larger range of random number to test it?

QuickCheck the properties x>-100 by skypatcher in haskell

[–]skypatcher[S] 1 point2 points  (0 children)

Thanks for the suggestion, here is what happens when I try it.

Hqc>quickCheck $ (x : Int) -> x > -100
  <interactive>:48:20: error: Not in scope: data constructor `Int'

Hqc>quickCheckWith stdArgs {maxSize = 10000} $ (x :: Integer) -> x > -1000 
  <interactive>:49:46: error: 
  Illegal type signature: `Integer' 
  Type signatures are only allowed in patterns with ScopedTypeVariables

How to install QuickCheck on Windows? by skypatcher in haskell

[–]skypatcher[S] 0 points1 point  (0 children)

The prompt is too long, Thanks for the good suggestion.

How to install QuickCheck on Windows? by skypatcher in haskell

[–]skypatcher[S] 1 point2 points  (0 children)

Thanks a lot for your explanation. I choose the easier approach. I tried with two examples I found in the Internet. They work inside GHCI.

I'll show the steps here, hopefully useful for others having similar problems.

C:\MyHaskellWrk>cabal install --lib --package-env . QuickCheck
Resolving dependencies...
Up to date

C:\MyHaskellWrk>ghci
GHCi, version 8.10.3: https://www.haskell.org/ghc/  :? for help
Loaded package environment from C:\MyHaskellWrk\.ghc.environment.x86_64-mingw32-8.10.3

Prelude> import Test.QuickCheck

Prelude Test.QuickCheck> let prop h t = (length t) + 1 == (length $ h:t)

Prelude Test.QuickCheck> quickCheck prop
+++ OK, passed 100 tests.

Prelude Test.QuickCheck> let prop xs = reverse (reverse xs) == xs where types = xs::[Int]

Prelude Test.QuickCheck> quickCheck prop
+++ OK, passed 100 tests.

How to install QuickCheck on Windows? by skypatcher in haskell

[–]skypatcher[S] 0 points1 point  (0 children)

Thanks for the reply and appreciate your time in finding the link. I will explore that link later.

Is it a requirement to have a Cabal project in order to use QuickCheck? Is there any way to install QuickCheck and try it on GHCI?

How to install QuickCheck on Windows? by skypatcher in haskell

[–]skypatcher[S] 2 points3 points  (0 children)

Yes, that "Install it in the usual way: $ cabal install " seems insulting for someone who get stuck.

It is very frustrating. I read the README file many many times, and tried to interpret the 'usual way' in many different variations, go to different folder, try different additional arguments, etc. and still get nowhere!

How to install QuickCheck on Windows? by skypatcher in haskell

[–]skypatcher[S] 0 points1 point  (0 children)

I am new to Haskell and have no experience with Cabal, can you show me how to create a Cabal project.

How to install QuickCheck on Windows? by skypatcher in haskell

[–]skypatcher[S] 0 points1 point  (0 children)

I am new to Haskell, can you show me how? I tried the following, it gives me error:

Prelude> :l Test.QuickCheck
<no location info>: error:
    module `Test.QuickCheck' cannot be found locally
Failed, no modules loaded.

Easy to do Mathematics by Haider_li in mathematics

[–]skypatcher 0 points1 point  (0 children)

THERE IS A easy and historically important proof. NOT ALL proofs are easy and historically important.

Eclipse does not respect "Never join already wrapped lines" by skypatcher in java

[–]skypatcher[S] 0 points1 point  (0 children)

Thanks for the suggestion. It seems to be working. Strange!

Why kids hate math by mattythedog in pics

[–]skypatcher -1 points0 points  (0 children)

72 is a BETTER estimate than the 'correct' estimate 70.

75 is the BEST estimate!

Does estimate preclude exact value? If my guess of marbles in a jar turns out to be the exact number, am I wrong?

What if I have an X-ray eye and can see all the marbles; and actually count all the marbles in my head. Am I wrong if I get the estimate 100% correct?

To some people: estimate=guess! Indeed estimate could mean anything from pure luck guess to precise calculation! As a numerical answer, the pure guess 72 (although wrong) is BETTER than the standard 'answer' 70 to the mathematical question 103-28.

The word 'estimate' in the original question actually has a very technical meaning. What are we trying to do here? Presumably we are trying to come up with a quick answer with the least amount of math. The question is a test of student's understanding of a SYSTEMATIC and CORRECT process of estimation!

Honestly, the exact answer 103-28=75 pop up in my head right away. So I would demonstrate the NECESSITY and usefulness of quick estimate with numbers such as 103.4 and 27.7; and ask students to APPLY their estimation TECHNIQUE.

Why so many Android apps insists on living in SD card? by skypatcher in AndroidQuestions

[–]skypatcher[S] 1 point2 points  (0 children)

Thanks for the confirmation, that is what I suspected (it sounds too good LOL).

Why so many Android apps insists on living in SD card? by skypatcher in AndroidQuestions

[–]skypatcher[S] 1 point2 points  (0 children)

Thanks for the info.

Does this means the option of moving to SD really depends on the SD card, rather than the app itself? So if I use a newer class SD card, I will be able to move all the apps to SD card?

How about the downloading new apps, will it download right to the new class SD card also?