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

Use MonadFail.fail, not Monad.fail. #912

Merged
merged 1 commit into from
May 1, 2019

Conversation

quasicomputational
Copy link
Collaborator

@quasicomputational quasicomputational commented Apr 27, 2019

This is a breaking change in API.

Monad.fail is no more with GHC 8.8, so this is a forced change.
However, it will also work on older GHCs.

This looks like most of the GHC 8.8 fallout for Dhall, so not much at all; the only other change I had to make to get it to build is to ifdef out a Monad.fail definition, and then presumably a load of bounds will need to be adjusted, as well as waiting on dependencies.

This isn't actually ready to merge yet because it needs sdiehl/repline#13 to be merged and then to make it into a release.

@quasicomputational
Copy link
Collaborator Author

Oh, never mind about it being a breaking change - all of the things I touched aren't exported, so consumers won't notice the difference!

@Gabriella439
Copy link
Collaborator

@quasicomputational: It looks like repline needs to add a MonadFail instance for HaskelineT:

https://hydra.dhall-lang.org/build/10819/nixlog/1

@quasicomputational quasicomputational force-pushed the monadfail branch 3 times, most recently from 4107d7a to bb7a137 Compare May 1, 2019 14:04
@quasicomputational
Copy link
Collaborator Author

quasicomputational commented May 1, 2019

Ah, here's trouble: there aren't MonadFail instances for the version of transformers that shipped with GHC 7.10. But, as noted, using MonadFail is mandatory on 8.8.

Options here:

  • CPP to switch between Monad.fail and MonadFail.fail.
  • Use a local definition of StateT with the instances we need.
  • Orphan instances, either local or from some shared package.
  • Drop 7.10 support.

Is the support window documented anywhere? Either of the first three options are basically hacks to support 7.10, and eventually they would go away when that's no longer relevant - but we'd need to know when that happens.

@quasicomputational
Copy link
Collaborator Author

Aha - transformers-compat has exactly the orphan instances we need. Crisis averted.

@quasicomputational quasicomputational force-pushed the monadfail branch 3 times, most recently from 22e94c9 to 2bcdf5e Compare May 1, 2019 15:33
@quasicomputational
Copy link
Collaborator Author

Now it's getting caught on transformers-compat's complicated configuration - it needs a different flag setting for each transformers version it builds against, and hence for each GHC. I'm not sure my Nix skills are up to this...

Monad.fail is no more with GHC 8.8, so this is a forced change.
However, it will also work on older GHCs.
@Gabriella439
Copy link
Collaborator

@quasicomputational: Don't worry, you did the right thing! It's okay to unconditionally add the fail build dependency to transformers-compat. Older versions will just ignore it and not use it

@Gabriella439 Gabriella439 merged commit 4f9defe into dhall-lang:master May 1, 2019
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

Successfully merging this pull request may close these issues.

None yet

2 participants