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?
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..]
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With