Changes between Version 44 and Version 45 of ExplicitCallStack


Ignore:
Timestamp:
Jan 30, 2007 4:51:43 PM (7 years ago)
Author:
guest
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ExplicitCallStack

    v44 v45  
    134134== What does Hat do? == 
    135135 
    136 As a starting point it is useful to see what Hat does, in particular hat-stack, which is the tool for generating stack traces. The example of `hd []` is exactly the kind of problem that hat-stack is designed to tackle. 
     136As a starting point it is useful to see what Hat does, in particular hat-stack, which is the tool for generating stack traces. The example of "`hd []`" is exactly the kind of problem that hat-stack is designed to tackle. 
    137137 
    138138Here is the stack trace generated for the example program. You can see the relevant line numbers in comments in the source code above. I've added comments to the hat output on the RHS to emphasise what the entries mean, when it is not immediately clear. 
     
    148148}}} 
    149149 
     150More-or-less this stack resembles: 
     151{{{ 
     152   d -> hd  
     153}}} 
     154 
     155Curiously, if we change the definition of `hd` to a function binding instead of a pattern binding we get this stack trace instead: 
     156{{{ 
     157   Program terminated with error: 
     158           hd: empty list 
     159   Virtual stack trace: 
     160   (unknown)       {?} 
     161   (I.hs:17)       error "hd: empty..." 
     162   (I.hs:16)       hd [] | case [] 
     163   (I.hs:6)        hd [] 
     164   (unknown)       d 
     165}}} 
     166 
     167Which is a little clearer, but still represents: 
     168{{{ 
     169   d -> hd 
     170}}} 
    150171 
    151172== Transformation rules ==