F# 中的元编程示例

发布于 2025-01-04 09:49:12 字数 208 浏览 2 评论 0原文

我对用 F# 编写的元编程示例感兴趣,这些示例演示了 F# 特定功能的使用,例如 TryGetReflectedDefinition 函数。

我在哪里可以找到这样的例子?

I'm interested in metaprogramming examples written in F# that demonstrate the use of F#-specific functionality such as the TryGetReflectedDefinition function in the F# standard library.

Where might I find such examples?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

百思不得你姐 2025-01-11 09:49:12

WebSharperUnquote 是使用引用的开源 F# 库的两个示例(Unquote 并未专门使用 TryGetReflectedDefinition,但我相信 WebSharper 确实如此)。

FSharp.PowerPack.Linq 是另一个示例。另外,我还找到了引用的实现< F# 编译器中的 /a> 是有用且富有洞察力的参考。

WebSharper and Unquote are two examples of open source F# libraries using Quotations (Unquote doesn't specifically use TryGetReflectedDefinition, but I believe WebSharper does).

FSharp.PowerPack.Linq is another example. Also, I've found the implementation of quotations in the F# compiler to be a helpful and insightful reference.

凯凯我们等你回来 2025-01-11 09:49:12

前段时间,我写了一个项目,使用 MSR Accelerator。

这是一个相当简单的翻译器(与相当复杂的 WebSharper 相比),但它应该演示您感兴趣的大部分功能。特别是,它翻译用 ReflectedDefinition 属性标记的函数。它也来自您最喜欢的科学计算领域:-)

Some time ago, I wrote a project that translates F# quotations to GPU code using MSR Accelerator.

This is a fairly simple translator (compared e.g. to WebSharper, which is pretty complex), but it should demonstrate most of the features you're interested in. In particular, it translates functions marked with the ReflectedDefinition attribute. It is also from your favorite scientific computing domain :-)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文