[Haskell-cafe] How can I use ghci more wisely?
krismicinski at gmail.com
Wed Jul 24 06:23:26 CEST 2013
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):
There was some discussion  on putting a limit to what the
interpreter prints out. Off the top of my head I suppose a hacky way
to do this would be to define a new type deriving show in a way that
printed out the list to some bounded depth.
On Tue, Jul 23, 2013 at 10:30 PM, yi lu <zhiwudazhanjiangshi at gmail.com> wrote:
> 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
> this wise way not the long long long list itself?
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
More information about the Haskell-Cafe