<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div><span></span></div><div><meta http-equiv="content-type" content="text/html; charset=utf-8"><div></div><div>Run ‘stack ghci’ and it will log the path to the YAML file you can edit to customize what configuration it uses when run outside of a project. Here you can specify additional packages you want to be available, and you set the resolver version which controls the GHC version. (Then you configure emacs to run ‘stack ghci’ instead of ‘ghci’.)</div><div><br></div><div>Jeff</div><div><br>On Jun 6, 2021, at 12:45 PM, Galaxy Being <<a href="mailto:borgauf@gmail.com">borgauf@gmail.com</a>> wrote:<br><br></div><blockquote type="cite"><div><div dir="ltr">As a beginner, I was told to use stack. And I seemed to get something Haskell installed initially on my Ubuntu 21.04. But stack seems to be geared toward projects and compiling executables with ghc, and not a global ghci REPL-based way. I'm using Emacs org mode "Babel" which allows for a very nice "literate" programming in tandem with a running REPL in many REPL-friendly languages, e.g., here are code blocks in an org-mode file<div><br></div><div><font face="monospace">#+begin_src haskell :results silent :exports code<br>data Peano = Zero | Succ Peano deriving (Show)<br>#+end_src</font></div><div><font face="monospace"><br></font></div><div><font face="monospace">#+begin_src haskell :results silent :exports code<br>myThree = Succ (Succ (Succ Zero))<br>#+end_src<br><br>#+begin_src haskell :results verbatim :exports both<br>myThree<br>#+end_src<br><br>#+RESULTS:<br>: Succ (Succ (Succ Zero))</font><br></div><div><br></div><div>I simply hit Evaluate (Ctr-C Ctr-C) and the evaluation is handled by a running ghci REPL started up in another Emacs buffer. Supposedly, a haskell-mode and a specific Babel ob-haskell package are working together to enable this. And so it works okay, once quirks (must enclose multi-lined code in :{..:} and every REPL session seems to need a :set +m as well). I'm really quite happy with this way of doing things and have resisted the whole monolithic 1) create project in a directory, 2) put code into .hs file, 3) compile with ghc.</div><div><br></div><div>But what I'm constantly having problems with is getting additional packages beyond the Prelude basics. My org files are in various directories, but I want (like most languages offer) to simply interact with that language on a global level wherever I am, whatever files and directories and Haskell code I'm working on. Sometimes doing an import works; often enough not. Then I have to do something with stack -- hopefully globally . . . and there the confusion and inconsistencies begin. Lately I can't seem to get <font face="monospace">Safe</font> installed. And all docs about editing some yaml stuff get me lost in the weeds quickly. What yaml where for my "global" situation?<br></div><div><br></div><div>If you simply say to me, Don't try to work outside of the project--hs files--compile to executable framework I'll say okay, then have to decide whether I want to stay within the org-mode world or leave Haskell for an org-mode friendlier language. And no, lhs and jupyter are primitive compared to org-mode literate programming. Both are a step backwards.</div><div><br></div><div>Any help on working outside the project box with stack, e.g., how to install and use packages (and even how to update/upgrade ghc and ghci would be a start!).</div><div><br></div><div>-<br></div><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div>⨽<br></div>Lawrence Bottorff<div>Grand Marais, MN, USA</div><div><a href="mailto:borgauf@gmail.com" target="_blank">borgauf@gmail.com</a></div></div></div></div></div>
</div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>Haskell-Cafe mailing list</span><br><span>To (un)subscribe, modify options or view archives go to:</span><br><span><a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a></span><br><span>Only members subscribed via the mailman list are allowed to post.</span></div></blockquote></div></body></html>