tweag / HaskellR

The full power of R in Haskell.
https://tweag.github.io/HaskellR
Other
584 stars 47 forks source link

Problem using H in Emacs #403

Open djsamperi opened 1 year ago

djsamperi commented 1 year ago

Describe the bug With some hacking I managed to get H to start in GNU Emacs, but the output is buffered, so not seen. A typical session in Emacs looks like this x = [r|sqrt(1:5)|] p x

:t x x :: MonadR m => ... So the output from the type query appears, but the output from the p command does not. If the program is now terminated with Ctrl-C the lost output of the p command appears, so it was clearly buffered when it shouldn't be. **To Reproduce** Under Windows, I put the following in .ghci set -fno-ghci-sandbox :set -XDataKinds :set -XGADTs :set -XPartialTypeSignatures :set -XOverloadedLists :set -XQuasiQuotes :set -XScopedTypeVariables :set -XTemplateHaskell :set -XViewPatterns :set -i/w/dev/github/HaskellR/H/.stack-work/dist/8a54c84f/build/H/autogen The last set is needed to prevent Paths_H autogen module from not being found. Now cd to HaskellR, run some trivial command to get Emacs Haskell mode to start, and type into Haskell mote prompte: :m +Language.R.Instance :m +H.Prelude.Interactive as H.Prelude initialize defaultConfig **Expected behavior** H mode should work like ghci mode with extra features for R. **Environment** - Windows 11 - 1.0.0 of HaskellR **Additional context** Initially I tried using this in .emacs.d/init.el: (setq haskell-program-name "stack exec H") This didn't work, perhaps because none of the expected output was reaching the terminal because of buffering.