I am using Tidal's emacs mode. I find it hard to import a module that is in a "hidden" package. In a plain ghci session, I could do any of
- start with naming (exposing) the package:
ghci -package random
- the same thing from inside ghci:
:set -package random
- un-hide the package globaly:
cabal install --lib random
then start ghci normally
after each of these, I can do import System.Random
in ghci.
Now, for the ghci session in a tidal buffer in emacs, using the numbering of the list just given:
- I cannot easily set that ghci option on the fly (?) I can write it in BootTidal.hs but I'd rather not touch that.
- I can execute that command but that results in
package flags have changed, resetting and loading new packages...
so it forgets all the definitions (d1
, etc.) from the boot file (and when I re-load the boot file, I'm back at the initial state, without the package) - I can do that, and for
random
I indeed might do it, but again, I'd rather not touch my global configuration.
So, yes, 1. and 3. are possible. Are there other ideas? (for realizing this on a per-session basis)
Hah, I thought I had a work-around for 2.: inside the session, do
:set -package random
:script something/something/BootTidal.hs
but - I cannot do the first line without a running Tidal instance, so I start it, but then the second line does not work, because it tries to start another, and then That port isn't available, perhaps another Tidal instance is already listening
.
Perhaps something like this would work if "start ghci" and "connect to supercollider" were separate?