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

Missing feature: generic predicate constructors #36

Open
necto opened this issue May 20, 2016 · 3 comments
Open

Missing feature: generic predicate constructors #36

necto opened this issue May 20, 2016 · 3 comments

Comments

@necto
Copy link
Contributor

necto commented May 20, 2016

Hello, it seems natural to have generic predicate_ctor as most of the other constructs in the annotation language. E.g. to define this kind of predicate constructors:

  predicate_ctor unimix<t>(predicate (void*,t) vp1,
                           predicate (void*,t) vp2)
                          (void* addr, t v) =
    [0.5]vp1(addr, v) &*& [0.5]vp2(addr, v);

this does not work: Parse error.
Is there a fundamental reason why it is not supported?

P.S. It does not disturb me much, as, unless the predicate is not recursive, I can embed it directly.

@btj
Copy link
Member

btj commented May 20, 2016

No fundamental reason; we just haven't needed it so far. Note that in some cases, a workaround is to use a block-local predicate (which can be in the scope of a type parameter of the enclosing function).

@btj btj changed the title generic predicate constructor Missing feature: generic predicate constructors Sep 2, 2016
@necto
Copy link
Contributor Author

necto commented Mar 18, 2018

How hard would it be to implement such a feature?

@btj
Copy link
Member

btj commented Mar 18, 2018

I think we need type reification (#125) for this to be sound.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants