I was wondering why error function returns this in ghci:
First with one call:
Prelude> error ""
*** Exception:
CallStack (from HasCallStack):
error, called at <interactive>:3:1 in interactive:Ghci1
Then with two:
Prelude> error (error "")
*** Exception: *** Exception:
CallStack (from HasCallStack):
error, called at <interactive>:2:8 in interactive:Ghci1
And with three and so on:
Prelude> error (error ( error ""))
*** Exception: *** Exception: *** Exception:
CallStack (from HasCallStack):
error, called at <interactive>:1:16 in interactive:Ghci1
Why there are many "*** Exception:" printed as error stacked?
I made this function that recieves a number and print exception that amount of times too:
printException n = foldr (\c r -> c error r) id (replicate n (.)) ""
But I was wondering also why
until (const False) error ""
Does not print Exception indefinitely.