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

Allow quotation expressions as type provider arguments #450

Open
baronfel opened this issue Oct 20, 2016 · 2 comments
Open

Allow quotation expressions as type provider arguments #450

baronfel opened this issue Oct 20, 2016 · 2 comments

Comments

@baronfel
Copy link
Contributor

baronfel commented Oct 20, 2016

Submitted by thinkb4coding on 6/10/2015 12:00:00 AM
30 votes on UserVoice prior to migration

This would enable scenarios where the type provider can rewrite, or abstract at compile time F# code and emit new one.
It could replace a macro system without the need for new syntax or tooling.

Original UserVoice Submission

@dsyme dsyme removed the open label Oct 29, 2016
@dsyme dsyme changed the title Allow quotations of expressions used as Type Provider arguments Allow quotation expressions as type provider arguments Oct 29, 2016
@rmunn
Copy link

rmunn commented Nov 2, 2016

In UserVoice, Don Syme noted that this will "almost certainly require #212 to be fully implemented".

@voronoipotato
Copy link

voronoipotato commented Dec 14, 2017

It would be nice if when doing this we also fold in an implementation of eval from one of the various libraries that already do this so that we can run quotation expressions without external dependencies. I honestly think easier, and more options for metaprogramming (like this) would also prevent Don from being pulled into various small language change quibbles.

Additionally projects like ConstraintTP would be able to move from using strings which have bad UX, to using quoted expressions. Right now the best proposed way of doing this that I could think of is using Fake as a preprocessor to basically regex replace <@ and @> with " when the line begins with [<Literal>] on compile. Using strings for metaprogramming imho kind of breaks the spirit of ML based languages, so it would make me very happy if we could find a creative resolution to this, even if it is basically doing the same thing that I was doing behind the scenes.

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

No branches or pull requests

4 participants