snowleopard / alga

Algebraic graphs
MIT License
717 stars 68 forks source link

Unable to use ghcid #260

Closed srid closed 3 years ago

srid commented 4 years ago

Full build (nix-build) succeeds, but I can't use ghcid for some reason.

image

snowleopard commented 4 years ago

I'm not using Nix, and can't reproduce with my setup.

Note that DeriveFunctor is in the default-extensions in the common stanza. Perhaps, you are using an old Cabal that doesn't support common stanzas?

andrewthad commented 3 years ago

The problem is almost certainly the use of default-extensions. If ghcid is just invoking ghci (rather than cabal repl), then the expecting extensions will not be enabled, and compilation will fail. The solution is simple: put {-# language DeriveFunctor #-} at the top of every module instead of using default-extensions.

snowleopard commented 3 years ago

@andrewthad Default extensions can also be enabled in the .ghci script, as I'm doing here:

https://github.com/snowleopard/alga/blob/f3382596498a69d8ebce1e0ccb36dd99e9ae3810/.ghci#L7-L12

Perhaps, it's just a matter of adding DeriveFunctor there? I'd be happy to accept a PR that does that if it fixes this issue for you.

andrewthad commented 3 years ago

I suspect that would fix it too. I don't use nix though, so I cannot replicate the OP's issue.

wbadart commented 3 years ago

@srid can you share the derivation you're using?

srid commented 3 years ago

I don't remember right now, but I believe I was using alga as an obelisk thunk in a GHC 8.6 project.

I'll close this as I'm not looking for a solution to this anymore, but feel free to open if anybody thinks this is worth supporting.