#5711: ghci asked me to report this
--------------------------+-------------------------------------------------
Reporter: guest | Owner:
Type: bug | Status: new
Priority: normal | Component: GHCi
Version: 7.2.1 | Keywords:
Os: Windows | Architecture: Unknown/Multiple
Failure: None/Unknown | Testcase:
Blockedby: | Blocking:
Related: |
--------------------------+-------------------------------------------------
<interactive>:1:1: Not in scope: `prc'
*Main>
ghc.exe: panic! (the 'impossible' happened)
(GHC version 7.0.3 for i386-unknown-mingw32):
thread blocked indefinitely in an MVar operation
Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug
----
I have tried to reproduce it but couldn't.
In case it may be of help I had loaded the following file 'baby.hs':
----
doubleMe x = x + x
doubleUs x y = doubleMe x + doubleMe y
doubleSmallNumber' x = (if x > 100 then x else x*2) + 1
qsort [] = []
qsort (a:b) = (qsort [x|x<-b,x <= a]) ++ [a] ++ (qsort [x|x<-b,x > a])
log10 x = log x / log 10
prec a b = -log10 ((max a b) / (min a b) - 1)
md x = take 3 [(a,b)|a<-[1..], b<-[1..], a < 2, b < 3]
----
and the previous history was: (dont't laugh at my attempts to learn
Haskell ;-)
----
(Num b0) arising from the literal `3' at <interactive>:1:15
(Integral b0) arising from a use of `^' at <interactive>:1:3
(Floating b0) arising from a use of `log' at <interactive>:1:6-8
Probable fix: add a type signature that fixes these type variable(s)
In the second argument of `(-)', namely `3'
In the second argument of `(^)', namely `((log 8) - 3)'
In the expression: 10 ^ ((log 8) - 3)
Prelude> 10.0^((log 8) - 3)
<interactive>:1:17:
Ambiguous type variable `b0' in the constraints:
(Num b0) arising from the literal `3' at <interactive>:1:17
(Integral b0) arising from a use of `^' at <interactive>:1:5
(Floating b0) arising from a use of `log' at <interactive>:1:8-10
Probable fix: add a type signature that fixes these type variable(s)
In the second argument of `(-)', namely `3'
In the second argument of `(^)', namely `((log 8) - 3)'
In the expression: 10.0 ^ ((log 8) - 3)
Prelude> 10.0^(3.1)
<interactive>:1:5:
Ambiguous type variable `b0' in the constraints:
(Integral b0) arising from a use of `^' at <interactive>:1:5
(Fractional b0) arising from the literal `3.1'
at <interactive>:1:7-9
Probable fix: add a type signature that fixes these type variable(s)
In the expression: 10.0 ^ (3.1)
In an equation for `it': it = 10.0 ^ (3.1)
Prelude> 10.0^3.1
<interactive>:1:5:
Ambiguous type variable `b0' in the constraints:
(Integral b0) arising from a use of `^' at <interactive>:1:5
(Fractional b0) arising from the literal `3.1'
at <interactive>:1:6-8
Probable fix: add a type signature that fixes these type variable(s)
In the expression: 10.0 ^ 3.1
In an equation for `it': it = 10.0 ^ 3.1
Prelude> 10.0^3
1000.0
Prelude> 10.0**3
1000.0
Prelude> 10.0**3.1
1258.9254117941675
Prelude> 10**((log 3.1) - (log 3))
1.078424691391861
Prelude> 10**((log 3.01) - (log 3))
1.0076919520923024
Prelude> log 10
2.302585092994046
Prelude> log10 10
<interactive>:1:1: Not in scope: `log10'
Prelude> log 10,10
<interactive>:1:7: parse error on input `,'
Prelude> :r
[1 of 1] Compiling Main ( baby.hs, interpreted )
Ok, modules loaded: Main.
*Main> log10 .002
<interactive>:1:8:
No instance for (Num (a0 -> c0))
arising from the literal `2'
Possible fix: add an instance declaration for (Num (a0 -> c0))
In the second argument of `(.)', namely `2'
In the expression: log10 . 2
In an equation for `it': it = log10 . 2
*Main> log10 0.002
-2.6989700043360183
*Main> -log10 0.002
2.6989700043360183
*Main> :r
[1 of 1] Compiling Main ( baby.hs, interpreted )
Ok, modules loaded: Main.
*Main> prec 3.001 3
3.4771212547197097
*Main> prec 3.003 3
2.999999999999951
*Main> prec 3 3.003
NaN
*Main> prec 3.0 3.003
NaN
*Main> prec 3.0 2.99
2.4756711883244296
*Main> :r
[1 of 1] Compiling Main ( baby.hs, interpreted )
Ok, modules loaded: Main.
*Main> prec 3.0 3.003
3.0004340774792846
*Main> prec 3.003 3
2.999999999999951
*Main> :r
[1 of 1] Compiling Main ( baby.hs, interpreted )
baby.hs:12:46: parse error on input `)'
Failed, modules loaded: none.
Prelude> :r
[1 of 1] Compiling Main ( baby.hs, interpreted )
Ok, modules loaded: Main.
*Main> prec 3.003 3
2.999999999999951
*Main> prec 3 3.003
2.999999999999951
*Main> :r
[1 of 1] Compiling Main ( baby.hs, interpreted )
Ok, modules loaded: Main.
*Main> md pi
<interactive>:1:1:
No instances for (Ord ((t0, t10) -> (t0, t10)),
Num ((t0, t10) -> (t0, t10)),
Floating (t0, t10))
arising from a use of `md'
Possible fix:
add instance declarations for
(Ord ((t0, t10) -> (t0, t10)),
Num ((t0, t10) -> (t0, t10)),
Floating (t0, t10))
In the expression: md pi
In an equation for `it': it = md pi
*Main> md 3
<interactive>:1:1:
No instances for (Ord ((t0, t10) -> (t0, t10)),
Num ((t0, t10) -> (t0, t10)),
Floating (t0, t10))
arising from a use of `md'
Possible fix:
add instance declarations for
(Ord ((t0, t10) -> (t0, t10)),
Num ((t0, t10) -> (t0, t10)),
Floating (t0, t10))
In the expression: md 3
In an equation for `it': it = md 3
*Main> md 3
<interactive>:1:1:
No instances for (Ord ((t0, t10) -> (t0, t10)),
Num ((t0, t10) -> (t0, t10)),
Floating (t0, t10))
arising from a use of `md'
Possible fix:
add instance declarations for
(Ord ((t0, t10) -> (t0, t10)),
Num ((t0, t10) -> (t0, t10)),
Floating (t0, t10))
In the expression: md 3
In an equation for `it': it = md 3
*Main> :r
[1 of 1] Compiling Main ( baby.hs, interpreted )
baby.hs:14:30:
Illegal parallel list comprehension: use -XParallelListComp
baby.hs:14:48: Not in scope: `a'
Failed, modules loaded: none.
Prelude> :r
[1 of 1] Compiling Main ( baby.hs, interpreted )
baby.hs:14:32: parse error on input `<-'
Failed, modules loaded: none.
Prelude> :r
[1 of 1] Compiling Main ( baby.hs, interpreted )
Ok, modules loaded: Main.
*Main> md 3
<interactive>:1:1:
No instances for (Ord ((t0, t10) -> (t0, t10)),
Num ((t0, t10) -> (t0, t10)),
Floating (t0, t10))
arising from a use of `md'
Possible fix:
add instance declarations for
(Ord ((t0, t10) -> (t0, t10)),
Num ((t0, t10) -> (t0, t10)),
Floating (t0, t10))
In the expression: md 3
In an equation for `it': it = md 3
*Main> md 3
<interactive>:1:1:
No instances for (Ord ((t0, t10) -> (t0, t10)),
Num ((t0, t10) -> (t0, t10)),
Floating (t0, t10))
arising from a use of `md'
Possible fix:
add instance declarations for
(Ord ((t0, t10) -> (t0, t10)),
Num ((t0, t10) -> (t0, t10)),
Floating (t0, t10))
In the expression: md 3
In an equation for `it': it = md 3
*Main> :r
[1 of 1] Compiling Main ( baby.hs, interpreted )
baby.hs:14:32: parse error on input `<-'
Failed, modules loaded: none.
Prelude> :r
[1 of 1] Compiling Main ( baby.hs, interpreted )
Ok, modules loaded: Main.
*Main> md 3
[(1,1),(1,2),(1,3)]
*Main> md 3
[(1,1),(1,2),(1,3)]
*Main> :r
[1 of 1] Compiling Main ( baby.hs, interpreted )
Ok, modules loaded: Main.
*Main> md 3
[(1,1),(1,2),(1,3)]
*Main> md 3
[(1,1),(1,2),(1,3)]
*Main> :r
[1 of 1] Compiling Main ( baby.hs, interpreted )
Ok, modules loaded: Main.
*Main> md 3
[(1,1),(1,2)Interrupted.
*Main>
*Main> :t prc
<interactive>:1:1: Not in scope: `prc'
*Main>
ghc.exe: panic! (the 'impossible' happened)
(GHC version 7.0.3 for i386-unknown-mingw32):
thread blocked indefinitely in an MVar operation
Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5711>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs