context-capabilities-initiative icon indicating copy to clipboard operation
context-capabilities-initiative copied to clipboard

Auto contexts

Open tmandry opened this issue 3 years ago • 1 comments

Motivation

Covered in https://blog.sunfishcode.online/context-brainstorming/

Details

TODO

tmandry avatar Jan 11 '22 22:01 tmandry

This post says a lot of good things. I would add though that I don't think negative bounds are correct for automatic contexts. Rather, like auto traits, they should be default context bounds that are relaxed...

fn totally_pure(a: &A) -> B
with
    ?ambient_authority +
    ?unwind
{
    // lots of interesting stuff
}

The syntax is up for debate; I personally find ! more readable but it doesn't actually express what we need here. True negative reasoning can complicate the type checker quite a bit so I'm not sure if we want to go that route.

tmandry avatar Jan 11 '22 22:01 tmandry