[Haskell-cafe] command substitution in ghci?

Johannes Waldmann johannes.waldmann at htwk-leipzig.de
Wed Jan 6 17:03:06 UTC 2021


In a ghci session,
I have an IO action that returns a file name,
and then I want to  :script  that file.
(The action could also be made to return the contents.)

Cf. Bash has $(foo) to allow the output of a command
to replace the command itself. See Bash manual  3.5.4
"Command Substitution" -  $(command) and  $(< file).

We do have a work-around,
since this is being called from an elisp program.
This is just about a micro-optimisation of not calling ghci twice.

https://github.com/tidalcycles/Tidal/issues/743

And the whole thing is a work-around for ghc and ghc-pkg
not agreeing on the use of environment files (I think)

- J.


More information about the Haskell-Cafe mailing list