public
Created

ghc-7.0.4 linux i386

  • Download Gist
gistfile1.hs
Haskell
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80
{-# LANGUAGE TemplateHaskell, FlexibleInstances #-}
 
import Test.QuickCheck
import Test.QuickCheck.All
 
instance (Bounded a, Enum a, Num a) => Eq (a -> a) where
f1 == f2 = and [f1 x == f2 x | x <- [minBound .. maxBound]]
t1, t2, t3 :: Int
 
t1 x = x * x
t2 x = (x-1)*(x+1)+1
t3 x = (x-2)*(x+2)+4
 
prop_x1 x = t1 x == t2 x
prop_x2 x = t2 x == t3 x
prop_x3 x = t1 x == t3 x
 
runTests = $quickCheckAll
 
{-
Fails here in ghci session with
 
:load "/home/alios/tmp/foo.hs"
GHCi, version 7.0.4: http://www.haskell.org/ghc/ :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
Loading package ffi-1.0 ... linking ... done.
Prelude> [1 of 1] Compiling Main ( /home/alios/tmp/foo.hs, interpreted )
Loading package pretty-1.0.1.2 ... linking ... done.
Loading package extensible-exceptions-0.1.1.2 ... linking ... done.
Loading package old-locale-1.0.0.2 ... linking ... done.
Loading package time-1.2.0.3 ... linking ... done.
Loading package random-1.0.0.3 ... linking ... done.
Loading package array-0.3.0.2 ... linking ... done.
Loading package containers-0.4.0.0 ... linking ... done.
Loading package template-haskell ... linking ... done.
Loading package QuickCheck-2.4.1.1 ... linking ... done.
 
/home/alios/tmp/foo.hs:11:1:
The equation(s) for `t1' have one argument,
but its type `Int' has none
 
/home/alios/tmp/foo.hs:12:1:
The equation(s) for `t2' have one argument,
but its type `Int' has none
 
/home/alios/tmp/foo.hs:13:1:
The equation(s) for `t3' have one argument,
but its type `Int' has none
 
/home/alios/tmp/foo.hs:15:13:
The function `t1' is applied to one argument,
but its type `Int' has none
In the first argument of `(==)', namely `t1 x'
In the expression: t1 x == t2 x
In an equation for `prop_x1': prop_x1 x = t1 x == t2 x
 
/home/alios/tmp/foo.hs:16:13:
The function `t2' is applied to one argument,
but its type `Int' has none
In the first argument of `(==)', namely `t2 x'
In the expression: t2 x == t3 x
In an equation for `prop_x2': prop_x2 x = t2 x == t3 x
 
/home/alios/tmp/foo.hs:17:13:
The function `t1' is applied to one argument,
but its type `Int' has none
In the first argument of `(==)', namely `t1 x'
In the expression: t1 x == t3 x
In an equation for `prop_x3': prop_x3 x = t1 x == t3 x
 
/home/alios/tmp/foo.hs:19:12:ghc: panic! (the 'impossible' happened)
(GHC version 7.0.4 for i386-unknown-linux):
Exotic form of kind ghc-prim:GHC.Prim.?{(w) tc 34g}
 
Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug
 
-}

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.