'How to debug a stack process being 'killed'?

I'm compiling a haskell file with

$ stack ghc --resolver lts-12.5 --package raw-strings-qq myscript.hs

and execute it with

$ ./myscript
Killed
$

on my Ubuntu machine. I get Killed as an error message and nothing else. How can I debug this? Does this mean the process takes up to much memory? Are there other possible sources of error?



Solution 1:[1]

The response you get from terminal as Killed is because you didn't give some commands:

  1. I use online IDE called Replit, so at the start it doesn't load needed libraries for you, you have to load manually:

     ghci -o main main.hs
    
  2. Sometimes, it automatically loads Main, sometimes it doesn't. So, if you don't see such thing like below, then you have to do it manually as well:

[1 of 1] Compiling Main ( main.hs, interpreted ) Ok, one module loaded. *Main>

   :l main

Maybe, it doesn't directly answer your question, but I got same exception like yours and dealt with it in that way. Well, same exception has the same problem (I guess)?

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Rahman