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

Programmatically access ghcid's status #143

Closed
srid opened this issue Mar 11, 2018 · 5 comments
Closed

Programmatically access ghcid's status #143

srid opened this issue Mar 11, 2018 · 5 comments

Comments

@srid
Copy link

srid commented Mar 11, 2018

My use case: I want to create something that does :r followed by main in GHCi whenever ghcid succeeds in rebuilding the project (main here runs a web server, so this effectively reloads the web server).

It is not totally clear to me how to do this, specifically having ghcid inform another process that it has succeessfully rebulit the project. Is there a way to do this?

@srid
Copy link
Author

srid commented Mar 11, 2018

Just discovered the -T flag!

@srid srid closed this as completed Mar 11, 2018
@ndmitchell
Copy link
Owner

Awesome, was just about to ask if -T met your needs :)

@srid
Copy link
Author

srid commented Mar 11, 2018

I still need to figure out a way to talk to a ghci session from outside ...

@ndmitchell
Copy link
Owner

https://hackage.haskell.org/package/ghcid-0.6.10/docs/Language-Haskell-Ghcid.html has ways to access ghci from outside - it's what ghcid is built on. It won't solve all use cases though.

srid added a commit to srid/slownews that referenced this issue Mar 16, 2018
@srid
Copy link
Author

srid commented Mar 16, 2018

@ndmitchell So I realized that I don't need to have a separate ghci session, and that I can instead re-use that of ghcid. This way I can run Reflex frontend apps using jsaddle-warp straight from ghcid's ghci session, and thereby get automatic server reloading for free!

cf. commit above.

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