Commit Graph

80 Commits

Author SHA1 Message Date
Sandy Maguire
ae577cc640 Release polysemy-plugin v0.4.1.0 2021-10-22 18:55:01 -04:00
Sandy Maguire
97b200e43d Cleanup -Wall and add context to bogus type family error 2021-10-22 18:38:44 -04:00
Sandy Maguire
c0cf61ea1f
Plugin: Solve ambiguous types based on instances in scope (#424)
* 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
2021-10-22 15:29:29 -07:00
Sandy Maguire
f30da0c178
Properly track skolems for plugin unification (#423)
* Properly track skolems for plugin unification

* Update haddock

* Cleanup imports

* Guard the import of unify
2021-10-20 16:16:48 -07:00
Torsten Schmits
2ddc66bc78 release 1.6.0.0 2021-07-12 13:33:42 +02:00
Torsten Schmits
6e2630fafd Add insertAt
A combinator that allows adding effects at a specified index into the
effect stack
2021-07-08 17:43:52 +02:00
Torsten Schmits
2d0f936926 update gh org in hackage description 2021-06-25 19:26:27 +02:00
Torsten Schmits
09c65bdae9 add changelog entry for GHC 9 support 2021-05-03 16:56:41 +02:00
Torsten Schmits
95c534bb10
start migration to ghc9 (#410)
* start migration to ghc9

* add ghc9 support for polysemy-plugin

* bump doctest version in package.yaml

* fix doctest message containing incorrect spaces

Co-authored-by: funketh <theodor.k.funke@gmail.com>
2021-05-03 16:45:18 +02:00
Torsten Schmits
04642d090b release 1.5.0.0/0.3.0.0 2021-03-30 19:51:37 +02:00
Torsten Schmits
bfe14bd4c9 update polysemy-plugin.cabal 2021-03-27 16:04:06 +01:00
Georgi Lyubenov
ef154f996a
Update repo in package.yaml
It's no longer hosted at isovectors account.
2021-03-21 01:27:04 +02:00
TheMatten
dc16f081f4
Drop support for GHC 8.4.*, update and fix dependencies (#405)
* Drop support for GHC 8.4.*, update and fix dependencies

* Remove 8.4.4 from CI

* Remove references to loopbreaker
2021-03-20 22:46:57 +01:00
Torsten Schmits
b8b912afae add basic nix build 2021-03-14 10:44:57 +01:00
TheMatten
ade8826e1c Update polysemy-plugin.cabal 2020-11-01 17:15:40 +01:00
TheMatten
146c177de7
Release plugin 0.2.5.2 (#388) 2020-11-01 14:08:07 +01:00
TheMatten
146ea88d11 Add Paths_* to generated-other-modules 2020-10-23 11:00:23 +02:00
TheMatten
5f14cd051d Remove optimization phases, update package.yaml-s 2020-10-23 09:56:15 +02:00
galagora
62f5af5d03
polysemy-plugin v0.2.5.1 (#377) 2020-09-15 09:21:05 +02:00
Jeremy Schlatter
235813da00
Small code simplifications (#360)
* 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>
2020-07-29 17:20:11 +02:00
Andrew Miller
64f63c7739 Support newer ghc-tcplugins-extra in latest stackage LTS 2020-06-18 22:30:42 +10:00
Georgi Lyubenov
ab362369dc Fix wrong date in polysemy-plugin changelog
Fixes #344
2020-06-15 07:49:45 +03:00
Georgi Lyubenov
4eece51af6 ifdef the 810 parts so we still build on older ghcs 2020-04-28 21:20:12 +03:00
Georgi Lyubenov
e82cbbd4d6 Fix import issues
* Ct (and friends) now comes from Constraints
* There was an ifdef'd part that uses a function "bool" which isn't
  imported when the ifdef triggers
2020-04-28 20:16:42 +03:00
KingoftheHomeless
3c731186cb
1.3.0.0 (#318)
* v1.3.0.0

* Update version and version bounds for polysemy and polysemy-plugin
2020-02-13 21:21:32 +01:00
KingoftheHomeless
a4868bddd4
Membership proof rewrite, membership testing, Bundle effect (#282)
* Union rewrite

* Exports, tests, and renamed KnownEffectRow

* Got rid of artifacts accidently introduced

* More documentation. tryMembership seperate from KnownRow

* 'expose' combinator

* Applied review suggestions, add Membership module

* Fixed a replace-all goof

* Scrap expose/Using in favor of interceptUsing/H

* Fixed Haddock failure
2019-12-08 13:52:37 +01:00
Sandy Maguire
8aa10efa8a Release polysemy-plugin-0.2.4.0 2019-10-29 13:38:04 +01:00
Sandy Maguire
d46a5ddc5e Patch package.yaml from #267 2019-10-28 17:25:30 +01:00
Samuel Evans-Powell
95b4b5508c Feature/cabal doctest and ghc 8.8.1 (#267)
* 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).
2019-10-28 17:13:44 +01:00
Sandy Maguire
c54a05fb3e Give a better error if polysemy can't be loaded by the plugin
Fixes #226
2019-10-23 15:48:08 +02:00
Sandy Maguire
b0a54f3bfa Run core-lint on the plugin tests 2019-10-09 14:51:03 +02:00
Sandy Maguire
a86aec37fb
Revert "Let plugin solve stuck type rows + bug fixes in interpreter mode (#245)" (#249)
This reverts commit 7a009f70b6.
2019-10-09 14:35:07 +02:00
Sandy Maguire
7a009f70b6
Let plugin solve stuck type rows + bug fixes in interpreter mode (#245)
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!
2019-10-09 14:07:46 +02:00
Sandy Maguire
4ca15a22e5 Release polysemy-plugin-0.2.3.0 2019-09-04 11:19:39 -07:00
KingoftheHomeless
7bda143878
polysemy-plugin: Reject ununifiable effect candidates early (#221)
* polysemy-plugin: Reject ununifiable effect candidates early

* Bump version, update changelog, expand tests
2019-09-04 17:11:01 +02:00
KingoftheHomeless
4a5f2ce92a
Add Final Effect (#217)
* Add Final Effect

* Changes per review, Final at top-level, doc changes

* Update Changelog

* Final touches to Final

* Revert change to stack.yaml
2019-08-30 22:38:53 +02:00
Sandy Maguire
de1607ea1b
Rename everything and its grandmother (#175) 2019-07-15 12:40:42 -04:00
Georgi Lyubenov
48b6768ad4 Rename Lift to Embed (#161)
* Move Polysemy.Internal.Lift to Polysemy.Lift.Type

* Add Polysemy.Lift module and runLift interpreter

* Add a Sandy reminder

* Add explicit foralls and split type signature

* Fix import spacing, for there is no "qualified"

* Implement runIO in terms of runLift

* Rename Lift -> Embed

* Replace sendM with embed

* Add a Sandy todo for embed version

* Rename runEmbed and related runEmbedded (from IO)

* runEmbedded -> runEmbeddedInIO
* runEmbed -> runEmbedded

* Update cabal
2019-07-11 11:02:26 -04:00
TheMatten
ec03b04e8e Fix ambiguously looking variables in smart constructors, refactor Polysemy.Internal.TH.Common 2019-07-08 21:52:29 +02:00
Sandy Maguire
f259f8ae78
Cleanup and document fundep plugin (#155)
I made the code style agree with the rest of the codebase, and I wrote down everything I know about how this works.
2019-07-05 14:14:45 -04:00
Sandy Maguire
83c1c20242 Release polysemy-plugin-0.2.2.0 2019-07-04 22:06:19 -04:00
Sandy Maguire
9e586eaeab
Redefine Type.Errors directly in polysemy (#153)
Fixes #152
2019-07-04 16:09:36 -04:00
Sandy Maguire
ef5ff1749a
Don't emit ambiguous effect errors for genuine type errors (#149)
This PR changes the plugin so it will notice an insoluble constraint of the form Sem r a ~ Foo, and mark that r takes part in a genuine type error. The plugin will then provide a bogus evidence term for IfStuck (IndexOf r _) _ _, which prevents the AmbiguousSend error message from firing.
2019-07-04 09:35:33 -04:00
TheMatten
8bbd9dc7d6 Use new, separate loopbreaker library for inlining (#145)
* Remove explicit loopbreakers, enable plugin

* Use uploaded version of `loopbreaker`

* Fix span of macro

* Disable plugin on GHC <8.6

* Add comment about use of plugin

* Separate unrelated conditions
2019-07-01 02:13:37 -04:00
Sandy Maguire
d2c8131cb8 Fix plugin badge 2019-06-26 10:23:06 -04:00
Sandy Maguire
6ca5b4f428 Release polysemy-plugin-0.2.1.1 2019-06-26 10:21:15 -04:00
Sandy Maguire
2654d35066
Forklift interpretations (#128)
This PR provides a single function withLowerToIO, which runs a desired Sem r effect all the way down to IO, without needing to know the natural transformation beforehand. It does it by running the desired code in a new thread, and shipping all of the unhandled effects back to the main thread. The main thread turns into an event loop for the duration of the withLowerToIO block.
2019-06-25 23:46:54 -04:00
Sandy Maguire
29216ceb69
Improve CI coverage -- now on GHC 8.4! (#39) 2019-06-19 17:25:37 -04:00
Sandy Maguire
6ffb4fd282
Remove Effect class (#118)
This thing was a vestige of the bad old days when you had to write
*instances* of classes things in Polysemy. It was a terrible experience,
and so we don't do that anymore. As a result, the only two instances of
`Effect` were for `Union` and `Yo` --- so I just inlined them.
2019-06-17 15:16:28 -04:00
Sandy Maguire
0a1ce2b837 Add hspec-discover to package build-tools
Fixes #111
2019-06-15 20:12:18 -04:00