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).
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.
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.
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!
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!
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!
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.
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.
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.
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.