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

Infer sharing and validity constraints for data constructors #6

Closed
robertkleffner opened this issue Jan 4, 2022 · 1 comment
Closed
Labels
enhancement New feature or request

Comments

@robertkleffner
Copy link
Collaborator

robertkleffner commented Jan 4, 2022

Currently, the programmer has to specify the sharing and validity constraints manually in constructor types for the compiler to get them right. For instance, instead of writing

rec data List a
    = Cons (List a) a --> (List a)
    | Nil --> (List a)

the programmer has to write

rec data List x
    = Cons {(List {a vd sd}) (vd & vl) (sd | sl)} {a v s} --> {(List {a (vd & v) (sl | s)}) (vd & v & vl & vr) (sd | sl | s | sr)}
    | Nil --> {(List {a v s}) (v & vr) (s | sr)}

Writing out the latter is tedious and easy to get wrong. But it's very pattern based and seems like it should be easy to automatically generate.

The concerns with automating this are:

  1. Will it be polymorphic enough?
  2. Will it be too polymorphic?
  3. Can the programmer plug in some custom sharing attributes without breaking it?
@robertkleffner robertkleffner added the enhancement New feature or request label Jan 4, 2022
@robertkleffner
Copy link
Collaborator Author

This was resolved, but the goal was reached via a different implementation method. Devs using Boba can still specify particular sharing constraints, and sharing constraints are fully specified by the type signature, not inferred. However, the written specification is now simpler.

@robertkleffner robertkleffner closed this as not planned Won't fix, can't repro, duplicate, stale Jul 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant