Commit Graph

35 Commits

Author SHA1 Message Date
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
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
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
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
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
Georgi Lyubenov
5bc01e0af6 Add runOutputAsList and a test for it (#140)
* Add runOutputAsList and a test for it

* Also use runOutputAsList in runTraceAsList
2019-06-29 17:40:56 -04:00
Sandy Maguire
e4b711a1ed
Fix intercept not hoisting itself into embedded computations (#134)
Fixes #133
2019-06-27 00:35:52 -04:00
Sandy Maguire
33a6d95dab
runResource via forklift (#130)
This PR adds `runResourceBase` (which is a crap name, but naming things is hard), which interprets `Resource` without the ugly `Sem r ~> IO` parameter. It's a nice solution to #84!
2019-06-26 00:08:55 -04:00
Sandy Maguire
8f3a4bcf19
Async effect (#129)
Here's an Async effect that does exactly what you'd expect.

Fixes #80
2019-06-26 00:01:12 -04:00
Sandy Maguire
29216ceb69
Improve CI coverage -- now on GHC 8.4! (#39) 2019-06-19 17:25:37 -04:00
Sandy Maguire
c3d3cc24f8
Stop using stack in Travis (#121)
The travis cache appears to be broken (probably due to the nightly stack?), but it just means CI takes like half an hour now. Since I already build on stack, I'm pretty sure it's fine --- also this will give a sanity check against accidentally breaking cabal build plans.

This improves CI times from ~30 minutes down to ~2.
2019-06-18 12:36:38 -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
bba49aaeb8
Don't emit the FirstOrder error for unknown effects (#115)
This PR introduces the FCF machinery that will give us more control over writing type-level functions. It defines an IfStuck a b c tyfam that will leave b around if a is stuck, otherwise it will fcf-evaluate c. Everything is polykinded so we can stack these things together to make big logic chains to emit specific variables depending on what exactly is stuck.
2019-06-16 17:14:36 -04:00
Sandy Maguire
82f86add29
Custom type error testing (#113)
This PR adds doctests allowing us to write tests for the custom type errors. Having this stuff reified in the test suite means we can iterate on the implementations and give much better QA.
2019-06-15 20:04:11 -04:00
Sandy Maguire
b7f2922c3a
Better Resource bracketing (#87) 2019-06-12 09:36:08 -04:00
TheMatten
974b8f11de Update smart constructors generation with tests and support for operators (#77) 2019-06-01 14:46:14 -04:00
Sandy Maguire
63b1f4257f
GetInspectorT (#71)
* Evacuation wip

* Two other uses of weave

* Evacuator -> Inspector

* Inspector test
2019-05-31 00:06:46 -04:00
Sandy Maguire
ad42c75fcf Release polysemy 0.2.1.0 2019-05-27 01:16:14 -04:00
Sandy Maguire
a20994abab
Fix broken higher order effects (#58)
* Fix a serious bug in interpretH and friends

* Spec to prove reader works now
2019-05-23 03:49:26 -04:00
Georgi Lyubenov
9536714449 Fix Sematic -> Semantic typo 2019-05-02 20:59:30 +03:00
Sandy Maguire
cb1aba83ee add runBatchOutput 2019-04-20 06:57:56 -04:00
Keagan McClelland
962f8b386b fixes test 2019-04-15 11:13:16 -06:00
Sandy Maguire
3f8489e28a fix test + reorder some params 2019-04-10 14:57:29 -04:00
Sandy Maguire
398022c669 change pkg structure 2019-04-08 16:16:14 -04:00
Sandy Maguire
1c63c1b4fc fix TH so it puts the tyvars in the right order 2019-03-20 14:34:36 -04:00
Sandy Maguire
b8fc7d8112 test for semantic to fuse away
also my TH has variables in the wrong order OOPS
2019-03-20 14:19:34 -04:00
Sandy Maguire
8a6d515e99 new effect module 2019-03-20 01:44:23 -04:00
Sandy Maguire
0684ea3dc6 rename Poly -> Semantic 2019-03-20 00:28:01 -04:00
Sandy Maguire
5d7d957b9a -> polysemy 2019-03-19 23:42:18 -04:00
Sandy Maguire
403708615b split up effects 2019-03-18 23:28:17 -04:00
Sandy Maguire
3bb46dc66d cleanup files 2019-03-18 23:16:52 -04:00
Sandy Maguire
2be94abfd1 tests 2019-03-18 23:04:21 -04:00
Sandy Maguire
130a18ad6a it is so FAST 2019-03-18 15:50:19 -04:00
Sandy Maguire
a8b1f247aa typesafe union 2019-03-17 14:09:09 -04:00
Sandy Maguire
9c8162a5b1 GLORY 2019-02-13 15:52:56 -05:00