Created
          April 7, 2022 17:39 
        
      - 
      
- 
        Save shapr/1e205f73d0d6e3d9c4617ce3e864f5f5 to your computer and use it in GitHub Desktop. 
    fails as expected
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | #!/usr/bin/env cabal | |
| {- cabal: | |
| build-depends: base | |
| , QuickCheck | |
| -} | |
| module Main where | |
| import Test.QuickCheck | |
| -- associative: ((a `op` b) `op` c) == (a `op` (b `op` c)) | |
| prop_associative_int :: Int -> Int -> Int -> Bool | |
| prop_associative_int a b c = ((a * b) * c) == (a * (b * c)) | |
| prop_associative_float :: Float -> Float -> Float -> Bool | |
| prop_associative_float x y z = ((x * y) * z) == (x * (y * z)) | |
| -- reflexive: is something equal to itself? | |
| prop_reflexive :: Float -> Bool | |
| prop_reflexive f = f == f | |
| prop_reflexive' :: Float -> Bool | |
| prop_reflexive' f = (f / 0) == (f / 0) | |
| main = do | |
| quickCheck $ (withMaxSuccess 10000) prop_reflexive' | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment