Commit Graph

394 Commits

Author SHA1 Message Date
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
Juan Paucar
fc508de2ec Add explicit quantifier for parameters on outputToTrace (#291) 2019-12-03 08:49:38 +07:00
Juan Paucar
3a63052f4f Update outputToTrace definition (#289) 2019-12-02 12:19:55 +01:00
KingoftheHomeless
30f465250f Add fromExceptionSem/Via and note (#276)
* Add fromExceptionSem/Via

* Add note

* Change placement of note in source code

* Mark Polysemy.Error utility functions as INLINABLE
2019-11-11 00:48:08 +07:00
Sandy Maguire
c2edfb3f33 credit where credit is due 2019-11-05 21:21:38 +01:00
Sandy Maguire
2acf651080 Merge branch 'master' of github.com:isovector/polysemy 2019-11-05 14:01:48 +01:00
Sandy Maguire
931c325358 Add Paweł's talk 2019-11-05 14:01:17 +01:00
Sandy Maguire
5aa84c8757
Disable loopbreaker (#274)
* Disable loopbreaker

* "Fix" Fusion

* whoops
2019-11-01 22:11:57 +01:00
KingoftheHomeless
93f8054e05
Revert functorial state of runNonDet to [] (#273)
* Revert functorial state of runNonDet to []

* Added a shouldNotBe
2019-11-01 21:20:32 +01:00
Sandy Maguire
4cce80c043
Law Machinery (#269)
This PR adds machinery for writing easy laws that should hold for an effect. It gives an example of what they'd look like for State s.
2019-11-01 19:57:53 +01:00
Sandy Maguire
25874923b9
View effect (#271)
* Add Tagged Effect

* Add View effect
2019-11-01 19:30:30 +01:00
KingoftheHomeless
62cddb6820 Add Tagged Effect (#223) 2019-11-01 19:23:01 +01:00
Sandy Maguire
10ecd396cd
Add fromException and fromExceptionVia (#270) 2019-11-01 17:54:54 +01:00
Sandy Maguire
8aa10efa8a Release polysemy-plugin-0.2.4.0 2019-10-29 13:38:04 +01:00
Sandy Maguire
d7d3a938f4 Release polysemy-1.2.3.0 2019-10-29 13:22:26 +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
Kevin Quick
80aa7d9033 Fix a couple of misspellings in comments. (#263) 2019-10-22 22:17:54 +02:00
Sandy Maguire
f47da2bf18 Export MemberWithError from Polysemy
Fixes #231
2019-10-22 19:56:33 +02:00
Sandy Maguire
256740d936 Remove trailing comment on getInspectorT
Fixes #251
2019-10-22 19:52:13 +02:00
Sandy Maguire
6be83b62bd Add rewrite and transform combinators
Fixes #237
2019-10-22 19:51:02 +02:00
Sandy Maguire
e1a500f02b Release polysemy-1.2.2.0 2019-10-22 19:40:43 +02:00
Sandy Maguire
b00d451d1e Ensure IO Resource interpreters handle Sem failure
The IO Resource interpreters had a bug in `BracketOnError` that would
fail to run the finalizers if the error was a Sem error (as opposed to
an IO exception.)

This PR also reworks the bracket spec so that it runs each test for
every interpreter, hopefully keeping them all in sync in the future.

Fixes #262
2019-10-22 19:35:22 +02:00
Georgi Lyubenov
378b7b11bf Depend on newer loopbreaker (#235) (#257) 2019-10-18 10:14:44 +01:00
Georgi Lyubenov
ee2956fa7f Depend on newer type-errors-pretty (#235) (#255) 2019-10-18 10:14:27 +01:00
Georgi Lyubenov
73099a1fb5 Depend on newer unagi-chan (#235) (#256) 2019-10-18 10:14:05 +01:00
Georgi Lyubenov
874e194629 Add a convenience atomicGets (#250)
* Add a convenience atomicGets

* Remove confusing comment
2019-10-11 10:18:30 +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
Sophie Taylor
557ce0d261 Add sequenceConcurrently to Async module (#248)
* Add `sequenceConcurrently` to Async module

* Expose `sequenceConcurrently` from module
2019-10-09 09:16:27 +02:00
Sandy Maguire
ac6d7b3121 Release polysemy-1.2.1.0 2019-09-15 21:42:33 +02:00
Sandy Maguire
d759dd7be8 Merge branch 'master' of github.com:isovector/polysemy 2019-09-15 21:40:50 +02:00
Sandy Maguire
825dfd6859 Release polysemy-1.2.0.1 2019-09-15 21:40:31 +02:00
Armando Santos
7e4297e5aa Add type synonym 'InterpreterFor' and documentation (#224)
* Add type synonym 'InterpreterFor' and documentation

* Apply suggested changes

* Revert indentation.
2019-09-07 18:37:35 +02:00
Sandy Maguire
4ca15a22e5 Release polysemy-plugin-0.2.3.0 2019-09-04 11:19:39 -07:00
Sandy Maguire
a49680d54b Release polysemy-1.2.0.0 2019-09-04 11:18:40 -07:00
Sandy Maguire
6b9c8485df Sinces 2019-09-04 11:17:24 -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
Dieter Houthooft
3fe084d4ed Add tutorial link in README.md (#222) 2019-09-04 07:36:41 -07:00
KingoftheHomeless
d1faef0be6
Fix mistakes in Final, add atomic/StateToIO (#218)
* Fix for mistakes in Final that slipped through the cracks.

* Add @sinces, atomic/StateToIO

* Update changelog
2019-09-02 06:45:53 +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
KingoftheHomeless
baa83700c3
Add subsume operation, expose raiseUnder/2/3 (#215)
* Add subsume operation, expose raiseUnder/2/3

* Fix new docs of raiseUnder, rearrange type vars in prj
2019-08-27 07:25:47 +02:00
KingoftheHomeless
205785c84e
Improve choice of functorial state for runNonDet (#210) 2019-08-22 19:50:29 +02:00
unknown
ccac856cd3 Revised comments about NonDetState in light of discoveries 2019-08-22 18:24:06 +02:00
unknown
6653cc6d31 Removed insignificant hyperlinks 2019-08-19 23:47:44 +02:00
unknown
affd736e41 Improve choice of functorial state for runNonDet 2019-08-17 16:38:36 +02:00
KingoftheHomeless
a93fb0e809 Add modify' to changelog (#208) 2019-08-15 22:26:57 -07:00
KingoftheHomeless
e950deb4ab Update changelog (#207) 2019-08-15 22:13:57 -07:00