Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cps attribute #1557

Open
mtzguido opened this issue Oct 8, 2018 · 1 comment
Open

cps attribute #1557

mtzguido opened this issue Oct 8, 2018 · 1 comment
Assignees
Labels
component/internal-apis about internal F* components, without user-level impact kind/enhancement priority/low

Comments

@mtzguido
Copy link
Member

mtzguido commented Oct 8, 2018

We have a cps attribute in prims, which is used for the M effect to make it processable by DM4F.

assume val cps : attribute
(* .... *)
effect M (a:Type) = Tot a (attributes cps)

But, we special case it a lot, to the point that one can even delete the definition of the cps attribute, since the desugarer recognizes that when it sees cps, it means to add the CPS cflag, without trying to interpret/lookup cps in any way.

So what's the point of the attribute? And did we expect to have many cps effects? Perhaps for layering?

For layering, I would have assumed the syntax would be something like:

new_effect_transformer StateT = {
    repr = fun a -> s -> M (a * s); 
    (* ... plus the usual DM4F *)
}

new_effect StExn = StateT EXN (* or similar *)

without a need for another M.

Summoning @kyoDralliam @nikswamy @catalin-hritcu @msprotz in case you guys remember. Personally I vote for removing the attribute and corresponding CPS flag.

@mtzguido mtzguido added kind/enhancement priority/low component/internal-apis about internal F* components, without user-level impact labels Oct 8, 2018
@mtzguido mtzguido self-assigned this Oct 8, 2018
@mtzguido
Copy link
Member Author

The cflag exists since the M effect gets unfolded (as it should) during typechecking, and we'd lose track of it otherwise. But the desugaring is crazy anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/internal-apis about internal F* components, without user-level impact kind/enhancement priority/low
Projects
None yet
Development

No branches or pull requests

1 participant