Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I Can't Stop Haskell From Listing Numbers

Tags:

haskell

My question is simple. I told Haskell b = [1..]. I then typed b. Now Haskell is listing all the natural numbers. How do I stop it from doing that?

like image 776
J126 Avatar asked Mar 21 '14 23:03

J126


1 Answers

It depends on the environment you're using, but try control-C. That should send an interrupt signal to GHCi. If you want to just get a certain number of elements from a list, you can use the take function: take 10 [1..].

like image 54
David Young Avatar answered Oct 17 '22 01:10

David Young