Changes between Initial Version and Version 1 of Ticket #1488


Ignore:
Timestamp:
Jul 4, 2007 7:20:02 AM (8 years ago)
Author:
simonpj
Comment:

Lennart adds: And ghci gives the only sensible answer. Once you start trying to be clever you're on the slippery slope to undecidability. How would one know where to stop? I would be most perturbed if Haskell were to try and ignore "unused" variables.

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #1488 – Description

    initial v1  
    11In the code
    2 
     2{{{
    33a x = let b = show x in 5,
     4}}}
    45ghci derives:
    5 a :: (Show a, Num t) => a -> t, which is correct, but I think the rules should be slightly altered, since in reality giving something to a which is not an instance of Show wouldn't be a problem, since it's not used in the first place.
     6{{{
     7a :: (Show a, Num t) => a -> t,
     8}}}
     9which is correct, but I think the rules should be slightly altered, since in reality giving something to a which is not an instance of Show wouldn't be a problem, since it's not used in the first place.
    610
    711One important application of this is testing a general data structure for one specific element type with assertions in the the general code and having a switch to turn generic and non-generic mode on and off. Unfortunately, this approach doesn't work today, since all kinds of constraints that are essentially part of the debugging process get added. Since deciding whether a certain variable is used is very easy in this setting(for example CPP macros that expand into "if debugging", where debugging will have a constant value. (I don't expect you to solve the Halting Problem).