Commit Graph

494 Commits

Author SHA1 Message Date
Sandy Maguire
83084f7eda Release polysemy 1.1.0.0 2019-08-15 14:30:06 -07:00
KingoftheHomeless
d7d3d4bb4f Add AtomicState and atomic interpreters for Output/Writer (#206)
* Add AtomicState and atomic interpreters for Output/Writer

* Fixed a word in docs, moved test functions around

* Remove runWriterIORef and runWriterTVar
2019-08-15 14:23:06 -07:00
Pepe García
a34efc142b add DataKinds to the checkExtensions list (#204)
* add DataKinds to the checkExtensions list

* return newline
2019-08-07 07:43:35 -04:00
KingoftheHomeless
26a6d2e474 Add Fail effect (#199)
* Add Fail effect

* Add inlining to Fail interpreters, make Fail newtype

* Hide visibility of Polysemy.Fixpoint.bomb, fix changelog

* Revert "Hide visibility of Polysemy.Fixpoint.bomb, fix changelog"

This reverts commit 5b043ed215.

* Move Polysemy.Internal.Fail to Polysemy.Fail.Type. Fixed inconsistency in docs
2019-08-06 09:07:54 -04:00
KingoftheHomeless
e4ad26105c Hide visibility of Polysemy.Fixpoint.bomb, fix changelog (#202) 2019-08-06 09:06:27 -04:00
KingoftheHomeless
5a28c435ec Add right-associative variants of runOutputMonoid and runWriter (#203)
* Add right-associative variants of runOutputMonoid and runWriter

* Fix bug in runWriterAssocR
2019-08-06 09:05:28 -04:00
KingoftheHomeless
829e3202fc Have AsyncSpec use locks instead of sleeps (#197) 2019-08-02 20:18:48 -04:00
Jason
39189d935e Fix typo in outputToTrace documentation (#198)
Fixes https://github.com/polysemy-research/polysemy/issues/189
2019-08-01 11:28:30 -04:00
KingoftheHomeless
5930ddf138 Fix strictness semantics of State and Writer (#194)
* Fix strictness semantics of State and Writer

* Made tests more rigorous

* Fixed inconsistency between Writer/Output tests

* Add more tests to cover the discrepancy between run and runM

* Use strict fmap to be on the safe side
2019-07-31 08:49:36 -04:00
Connor James
51b777b3bb Add runOutputSem interpreter (#191) 2019-07-27 16:23:08 -04:00
KingoftheHomeless
4dc09e719b Improve semantics of Fixpoint (#187)
* Improve semantics of Fixpoint

* Add tests for Fixpoint, update docs

* Made the error test more rigorous

* Added references in the docs for 'runFixpoint'
2019-07-27 16:11:11 -04:00
Kit Langton
93fc63ce8c Update README.md with Lift -> Embed renaming. (#190)
Update README.md with `Lift` -> `Embed` renaming.
2019-07-27 20:53:35 +02:00
KingoftheHomeless
752369b071 Simplified Forklift machinery (#186) 2019-07-24 11:40:19 -04:00
Sandy Maguire
f2ca91d57d Release polysemy-1.0.0.0 2019-07-24 10:45:42 -04:00
TheMatten
d803c81054 Document change in semantics based on order of interpreters (#181)
* Polysemy.Internal: document change in semantics based on order of interpreters

* Polysemy.Internal: use new 'evalState' instead of mapping 'runState' in example

* Polysemy.Internal, DoctestSpec: properly support doctest

* Polysemy.Internal: small corrections
2019-07-24 09:50:56 -04:00
Jack Henahan
c53357ca92 Add performance instructions to README (#185) 2019-07-24 08:35:44 -04:00
Dmitrii Kovanikov
011530bba1 [#180] Use type-errors-pretty package (#182)
Resolves #180
2019-07-20 08:48:42 -04:00
KingoftheHomeless
8b1f6d3deb Added nonDetToError (#179) 2019-07-18 20:50:22 -04:00
KingoftheHomeless
8812d0a6b9 Removed redundant constraint from ignoreTrace (#178) 2019-07-16 16:24:56 -04:00
Sandy Maguire
de1607ea1b
Rename everything and its grandmother (#175) 2019-07-15 12:40:42 -04:00
KingoftheHomeless
d12adcd780 Make NonDet Higher-Order (#174)
* Higher-Order NonDet and runNonDetMaybe

* Fixed docs

* Fixed a word in AlternativeSpec docs

* Fixed tests and wrong documentation
2019-07-15 11:53:18 -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
9bfb486769
Merge pull request #171 from TheMatten/th-ambiguous-names
Fix ambiguously looking variables in smart constructors, refactor Polysemy.Internal.TH.Common
2019-07-09 20:01:10 +02:00
TheMatten
94b5dfe08e Remove unused error 2019-07-09 07:45:06 +02:00
TheMatten
3e1f100341 Reenable data families and their tests 2019-07-09 07:43:07 +02:00
TheMatten
766ac0935d Remove data families tests completely 2019-07-08 22:35:23 +02:00
TheMatten
ec03b04e8e Fix ambiguously looking variables in smart constructors, refactor Polysemy.Internal.TH.Common 2019-07-08 21:52:29 +02:00
TheMatten
7807c6b171 Merge https://github.com/isovector/polysemy into th-ambiguous-names 2019-07-08 21:40:39 +02:00
Sandy Maguire
d000121a5f Forgot my thanks! 2019-07-08 10:22:29 -04:00
Sandy Maguire
f93e6d9111 Release polysemy-0.7.0.0 2019-07-08 10:19:25 -04:00
KingoftheHomeless
fff2c96ce3 Added inlining to Polysemy.Writer (#170) 2019-07-08 10:15:39 -04:00
KingoftheHomeless
0d22cdaba0 Add Pass to Writer, replacing Censor. Fix semantics of listen (#169)
* Added Pass to Writer, replacing Censor. Fixed semantics of listen

* Swap order of elements in the Pass tuple

* Sometimes I'm bad! Fixed compile error.
2019-07-08 09:59:33 -04:00
Sandy Maguire
8a22cc29e1
Change tyvar orders (#167)
Change the order of some tyvars so they're more convenient for type applications
2019-07-07 14:36:51 -04:00
TheMatten
4fe424cfce Merge https://github.com/isovector/polysemy 2019-07-07 17:35:50 +02:00
Sandy Maguire
faaf1e3a96
Don't use Loopbreaker until GHC 8.7+ (#164)
Turns out haddocks have been broken forever, but because of haskell/cabal#5977 we never noticed. This PR fixes CI so it breaks (see 6f915b6), and then fixes it by changing the GHC versions under which we're allowed to use loopbreaker. Fixes #160
2019-07-07 11:27:18 -04:00
Sandy Maguire
9f3a476afd
Rename Yo ==> Weaving (#162)
The name Yo is objectively terrible. I changed it, and added some documentation.
2019-07-06 09:16:07 -04: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
TheMatten
1786925e72 Merge https://github.com/isovector/polysemy 2019-07-05 20:05:27 +02:00
Sandy Maguire
83c1c20242 Release polysemy-plugin-0.2.2.0 2019-07-04 22:06:19 -04:00
Sandy Maguire
082ed39e85 Release polysemy-0.6.0.0 2019-07-04 22:05:51 -04:00
Silvan Mosberger
210d8d6a35 Improve runBatchOutput (#158)
This function now transforms an Output o into Output [o], which only outputs elements once the specified number of o's have been collected. The only exception is the last element which contains the rest (if any).
2019-07-04 18:27:13 -04:00
Sandy Maguire
9e586eaeab
Redefine Type.Errors directly in polysemy (#153)
Fixes #152
2019-07-04 16:09:36 -04:00
TheMatten
e3ab51b2bd Merge https://github.com/isovector/polysemy 2019-07-04 20:50:48 +02: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
Sandy Maguire
d9dab9fa6a
Implement runEmbedded (#148)
runEmbedded lets you interpret a `Lift m` via some `forall x. m x -> IO
x` by pretending all the other polysemy actions are in IO and using its
MonadIO instance.
2019-07-04 07:45:40 -04:00
Sandy Maguire
72e060ac79
Parenthesize r when it's a cons (#147)
When emitting messages for ambiguous sends: use `IfStuck` on `r` to
determine if we can compose it. This means `r` is in one of three
states, stuck, cons or nil. We want to wrap it in parentheses iff it's
a cons.
2019-07-04 07:45:09 -04:00
Sandy Maguire
13fc3a1649
Remove some loopbreakers that were left around (#150) 2019-07-04 07:43:14 -04:00
Sandy Maguire
482de98afe
Use type-errors for our type errors! (#144)
This PR has farmed out the type error machinery out to my new package https://github.com/isovector/type-errors. It's much nicer to work with, and a big red diff!
2019-07-03 16:05:51 -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
d82d48cdf6
Improved errors (#143)
This shuffles around the error messages so they are only connected to code generated via makeSem. This means that badly-typed interpreters will no longer set off the eager error messages!
2019-06-29 23:37:56 -04:00