[GHC] #9207: Detect obvious cases of infinite recursion.
GHC
ghc-devs at haskell.org
Sun Nov 18 13:23:54 UTC 2018
#9207: Detect obvious cases of infinite recursion.
-------------------------------------+-------------------------------------
Reporter: mrugiero | Owner: (none)
Type: feature request | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 8.4.4
Resolution: | Keywords: infinite
| recursion
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by svenpanne):
OK, let's forget about the warning caused by not using `loadImg` for a
moment.
Why should a compiler warn about the body of `loadImage`? I seriously hope
that it doesn't warn, because `liftIO` is a method of the `MonadIO` type
class, so the compiler has no knowledge whatsoever about it, apart from
its type. So passing `loadImage fpath` to it might actually make sense,
see the `repeat` example above. If you are lucky and the compiler uses
enough optimizations, you might get a warning at `loadImage`'s use sites,
because then it might see enough context, but the function alone is
perfectly OK from a compiler's point of view.
In a lazy language, it's quite hard to distinguish between "wanted
infinite recursion" and "unwanted infinite recursion".
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9207#comment:12>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list