This portion of haskell-mode (haskell-interactive-mode-eval-pretty) is what
the UI for something like this could look like:
https://www.youtube.com/watch?v=pu9AGSOySlE
This isn't an answer to your question, though, because expanding subparts
of the output doesn't drive evaluation. It would be
Hi,
Am Mittwoch, den 24.07.2013, 01:41 -0700 schrieb Michael Sloan:
Another non-answer is to take a look at using vaccum[0] and
vaccum-graphviz[1] together, to get an idea of the heap structure of
unforced values. I've made a gist demonstrating how to use these to
visualize the heap without
The data-pprint package's pprint function might give you a quick fix.
For example:
Prelude :m Data.PPrint
Prelude Data.PPrint pprint [1..]
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
37, 38, 39, 40, 41,
You might like to know about this option for ghci -interactive-print
I tested it with data-pprint though and it didn't work because it
returns an IO Doc instead of IO () (I assume). But if you wrote a
function that used that, returned the right type, cabal installed it
and put it in your .ghci,
Thanks for the tip, David, I didn't know about that flag! Looks
really handy for playing with EDSLs, which is usually better off
displayed through Doc, but the default Show instance is indispensable
when I find a bug in the conversion to the Doc.
Unfortunately, though, I'd be reluctant to make
I am wondering how can I ask ghci to show an infinite list wisely.
When I type
*fst ([1..],[1..10])*
The result is what as you may guess
*1,2,3,4,...*(continues to show, cut now)
How could I may ghci show
*[1..]*
this wise way not the long long long list itself?
Yi
Knowing whether a computation will terminate is in general the halting
problem, so immediately you're looking at a syntactic restriction.
Here the only ones I can think of are artificial at best (i.e., they
don't work for examples more than what you've shown here):