Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why does IHaskell output stdout/stderr as display_data instead of stream? #1354

Open
thomasjm opened this issue Jun 28, 2022 · 1 comment
Open

Comments

@thomasjm
Copy link
Member

Apologies if this has already been answered, but I couldn't find it.

When you run a simple print like putStrLn "hi", IHaskell outputs it as a Jupyter display_data output like the following:

    {
     "output_type": "display_data",
     "metadata": {},
     "data": {
      "text/plain": [
       "\"hi\""
      ]
     }
    }

Most Jupyter kernels would output this using the stream type. For example, if I run print("hi") in the Python kernel, I get:

    {
     "output_type": "stream",
     "name": "stdout",
     "text": [
      "hi\n"
     ]
    }

It doesn't cause any major problems, but it does render slightly differently in the notebook and can cause confusion for other tools that try to deal with output from Jupyter notebooks (such as papermill).

Is there a reason it works this way? Would you accept a PR to change it? Thanks in advance for any clarification.

@vaibhavsagar
Copy link
Member

I'm not aware of any reason we use display_data instead of stream here, but I worry this might be a bigger change than it appears to be at first. I'd welcome a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants