[GHC] #10688: Incorrect program produced, different result with equivalent code
GHC
ghc-devs at haskell.org
Sat Jul 25 20:10:18 UTC 2015
#10688: Incorrect program produced, different result with equivalent code
-------------------------------------+-------------------------------------
Reporter: Ideophage | Owner:
Type: bug | Status: new
Priority: lowest | Milestone:
Component: Compiler | Version: 7.10.1
Resolution: | Keywords:
Operating System: Linux | Architecture:
Type of failure: Incorrect result | Unknown/Multiple
at runtime | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Revisions:
-------------------------------------+-------------------------------------
Changes (by Ideophage):
* priority: normal => lowest
Old description:
> The program enters an infinite loop (100% cpu, not stopping) because it
> fails to recognize the stopping condition of a takeWhile. If we make the
> list finite, it takes all the elements while it should stop before.
>
> I don't know how to simplify the code since if I change it a little (e.g.
> by replacing the name of an object by its definition), sometimes it works
> well, sometimes not.
>
> When I enter the code in ghci, it works well but not when compiled.
>
> I don't know if I should explain what the code was for initially, tell
> me.
New description:
The program enters an infinite loop (100% cpu, not stopping) because it
fails to recognize the stopping condition of a `takeWhile`. If we make the
list finite, it takes all the elements while it should stop before.
I don't know how to simplify the code since if I change it a little (e.g.
by replacing the name of an object by its definition), sometimes it works
well, sometimes not.
When I enter the code in ghci, it works well but not when compiled.
I don't know if I should explain what the code was for initially, tell me.
edit :
Actually, I realized that this is not a bug. This is due to the lack of
type signatures in my program. I thought that was a bug because sometimes
the program used `Int`s, sometimes `Integer`s, and just expanding a
definition can change this (see the code in attachment). I apologize for
opening a ticket for that (I thought `Integer`s were used since it is the
case in ghci).
--
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10688#comment:2>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list