* Remove Member type errors
* Remove unused custom type errors
* Deprecate MemberWithError
* Remove readme notes about type errors
* Remove MemberWithError
* Properly track skolems for plugin unification
* Cleanup imports
* Add test
* Stuff can now reference different packages
* Tools for looking up instances
* Add extra evidence
* Solve AmbiguousSpec :)
* Check givens for extra evidence
* Use StateT to cache instance lookups
* Remove numClass from Stuff
* Documentation
* Fix AmbiguousSpec
* Don't need deriving strategies anymore
* GHC9 imports
* Polymorphic and MTPC tests
* Small code simplifications
These are all replacements of the form
before: fmap f $ x
after: f <$> x
Minor change, but feels marginally easier to read to me.
Co-authored-by: TheMatten <matten@tuta.io>
* Use cabal-doctest
- Haskell build tools run in slightly different environments (meaning different
package databases are available).
- The nixpkgs build for polysemy-plugin is failing due to a missing package
database, which causes the doctest to fail (more information here:
https://github.com/NixOS/nixpkgs/issues/71164).
- By using cabal-doctest we can expose the Haskell packages required to the
doctests no matter the build tool we're using.
* Use cabal-doctest in polysemy, build on GHC 8.8.1
- Use @googleson78 's changes to build polysemy on GHC 8.8.1, with slight
modifications. The source distribution is now found in "dist-newstyle/sdist",
so we've updated the command to point at that folder. Additionally, cabal
v2-install doesn't support installing .tar.gz files in the same way v1-install
did, so updated the command to use "cabal v1-install".
- Modified polysemy to use "cabal-doctest" and so overcome issues with the
doctest tests (see issue #258, PR #265).
In interpreter mode, the plugin used to see rows like State (Identity a) ': State a ': r, with an action in State a, and then incorrectly unify that thing with the first thing in the list State (Identity a). As a result, we'd ask for Identity a ~ a, which is infinite, and things would go wrong.
Now we instead collect all of the unifications we'd like to do, and only emit the most specific one, as measured by number of type constructors in it. This will now only emit a State (Identity a) ~ State (Identity s), and then unify the state we're looking for, plus the a ~ s that solves the other state action.
But the next problem is that we can't determine IndexOf in the row above, because a is a type variable, and so IndexOf is stuck, even though we know IndexOf that_row (State a) ~ 'S 'Z. So the plugin now also solves "stuck" IndexOfs of that form.
All of this means we can now happily introduce local effects that have type variables, for effects that are already known to be present in the row. And somehow it just works! Amazing!