Re: [Haskell-cafe] Program used for debugging

2011-12-02 Thread Rustom Mody
On Thu, Dec 1, 2011 at 7:40 PM, Yves Parès limestr...@gmail.com wrote:

 Hey,

 What do you mostly use for debugging?
 Simple calls to Debug.Trace.trace? Hpc? Hood?


I also wonder about 'type-debugging'

Using ghci:
For a top level expression:
 - if it is not compiling I can put in (or remove) a type decl and see how
things change.
 - if it is compiling I can of course :t it

But for internal expressions it can be quite hairy to figure out why what
haskell thinks is the type of something and what I think dont match.

So is there something like type-intellisense for haskell where if one
hovers the mouse (maybe over a selection) haskell tells what type it finds
there?
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Program used for debugging

2011-12-02 Thread Yves Parès
 But for internal expressions it can be quite hairy to figure out why what
haskell thinks is the type of something and what I think dont match.

^^ Just give the internal expression a type you know to be wrong, then GHC
will display the infered type and say it doesn't match the one you wrote.

2011/12/2 Rustom Mody rustom.m...@parsci.com

 On Thu, Dec 1, 2011 at 7:40 PM, Yves Parès limestr...@gmail.com wrote:

 Hey,

 What do you mostly use for debugging?
 Simple calls to Debug.Trace.trace? Hpc? Hood?


 I also wonder about 'type-debugging'

 Using ghci:
 For a top level expression:
  - if it is not compiling I can put in (or remove) a type decl and see how
 things change.
  - if it is compiling I can of course :t it

 But for internal expressions it can be quite hairy to figure out why what
 haskell thinks is the type of something and what I think dont match.

 So is there something like type-intellisense for haskell where if one
 hovers the mouse (maybe over a selection) haskell tells what type it finds
 there?

 ___
 Haskell-Cafe mailing list
 Haskell-Cafe@haskell.org
 http://www.haskell.org/mailman/listinfo/haskell-cafe


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Program used for debugging

2011-12-01 Thread Yves Parès
Hey,

What do you mostly use for debugging?
Simple calls to Debug.Trace.trace? Hpc? Hood?
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Program used for debugging

2011-12-01 Thread Ivan Lazar Miljenovic
On 2 December 2011 01:10, Yves Parès limestr...@gmail.com wrote:
 Hey,

 What do you mostly use for debugging?
 Simple calls to Debug.Trace.trace? Hpc? Hood?

trace and ghci.

-- 
Ivan Lazar Miljenovic
ivan.miljeno...@gmail.com
IvanMiljenovic.wordpress.com

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Program used for debugging

2011-12-01 Thread Andrew Butterfield

On 1 Dec 2011, at 14:10, Yves Parès wrote:

 Hey,
 
 What do you mostly use for debugging?
 Simple calls to Debug.Trace.trace? Hpc? Hood?

Debug.Trace, with some short helpers

so  
 dbg x= x  
displays the value of x, provided x is in Show

import Debug.Trace

dbg msg x = dbgsh show msg x
dbgsh sh msg x = trace (msg++sh x) x
cdbg p msg x
 | p x=  dbg msg x
 | otherwise  =  x

-- if you want to tailor the show:
class Dshow t where dshow :: t - String
ddbg msg x = dbgsh dshow msg x
 ___
 Haskell-Cafe mailing list
 Haskell-Cafe@haskell.org
 http://www.haskell.org/mailman/listinfo/haskell-cafe


Andrew Butterfield Tel: +353-1-896-2517 Fax: +353-1-677-2204
Lero@TCD, Head of Foundations  Methods Research Group
Director of Teaching and Learning - Undergraduate,
School of Computer Science and Statistics,
Room G.39, O'Reilly Institute, Trinity College, University of Dublin
  http://www.scss.tcd.ie/Andrew.Butterfield/


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe