Shows how to use the 'ExprShape' module to recursively traverse an entire quotation and how to write quotation transformations. As an example, the snippet replaces all numeric constants in the quotation and then runs the transformed code.
26 people like thisPosted: 13 years ago by Tomas Petricek
This snippet implements a Clojure-like lambda function syntax using Code Quotations. However, this implementation is slow and, moreover, not type-safe. So I'm looking for a way to solve the issues.
6 people like thisPosted: 13 years ago by einblicker
The snippet implements a function "expand" that takes a quotation and performs two operations. It replaces all calls to methods marked with ReflectedDefinition with the body of the method and it simplifies all expressions that can be reduced in call-by-name style (let binding & application of lambda).
7 people like thisPosted: 12 years ago by Tomas Petricek
Simple combinator library to declarative validation.
17 people like thisPosted: 12 years ago by Kaspar
Evaluates a useful subset of F# quotations at run-time (without the F# PowerPack API).
15 people like thisPosted: 11 years ago by Phillip Trelford
How to generate functions for copying F# record-array-union trees with Expr.
1 people like thisPosted: 10 years ago by Rick Minerich
This function compiles an F# quotation to a JavaScript string, or prints errors to stderr and returns None on failure.
4 people like thisPosted: 9 years ago by Loïc `Tarmil` Denuzière
Allows you to pretty print a quotation.
7 people like thisPosted: 8 years ago by Colin Bull
An exploration of the power of Computation Expressions, Type Extensions, Extension Methods, and Method Overloading. May or may not be a monad or a monoid - we're not sure, nor do we care to check.
7 people like thisPosted: 6 years ago by Tomas Petricek, Krzysztof Cieślak, John Azariah, Phillip Carter
Optimizing F# quotations by applying Normalization-by-Evaluation
3 people like thisPosted: 4 years ago by Eirik Tsarpalis
This is a recursive active pattern for extracting the elements of a list quotation as a list of Exprs, There doesn't seem to be a List pattern in the standard library. The compiler will complain about this recursive pattern unless you use #nowarn "40".
4 people like thisPosted: 3 years ago by allisterb
This code sample shows how to create a function that raises number to a given power using supercompilation with quotations. For any given power, the function returns quoted expression for calculating the power using explicit multiplications, which is then evaluated.
21 people like thisPosted: 13 years ago by Dmitry Soshnikov
Sometimes it is extremely useful to check some calculations with Excel. The snippet shows how F# expressions can be transformed into Excel formulae. The data is exported together with the formulae, e.g. a, b and sum function as input sets A1's value to a, B1's to b and C1's formula to "=$A$1+$B$1"
17 people like thisPosted: 12 years ago by Natallie Baikevich
A sample that translates simple F# quotations (method calls, property getters) to stnadard C# LINQ expression trees.
7 people like thisPosted: 12 years ago by Tomas Petricek
F# Mocking library with a fluent interface Moq users should find familiar. Generate mocks for interfaces and abstract types. Supports mocking methods, properties and events. Specify arguments as wildcards or values to match. Define results as values, computed values or exceptions.
6 people like thisPosted: 12 years ago by Phillip Trelford
Filter by list of properties when provider supports filter expressions but doesn't support Contains. Equivalent C# : https://gist.github.com/mausch/6893533
2 people like thisPosted: 11 years ago by Mauricio Scheffer
Normalisation of "F# quotations" by evaluation.
4 people like thisPosted: 9 years ago by Nick Palladinos
Using F# 4.0 Automatic Quotations to mutate provided XML documents with static type checking
2 people like thisPosted: 9 years ago by Green Eagle Solutions
A simple evaluator for F# quotations using TypeShape
2 people like thisPosted: 7 years ago by Eirik Tsarpalis
Demonstrates how to compose code at run time using F# quotations (both typed and untyped) and how to compile and run/execute the quotation using F# Quotations Evaluator (based on F# 2.0 PowerPack code) from the F# Software Foundation. (Updated October 25, 2019)
0 people like thisPosted: 5 years ago by Tomas Petricek, Zane Purvis
A quick snippet showing three different ways of dynamically/reflectively locating a module then invoking a generic function. The first two don't rely on a class. But the third is more readable/understandable for most .NET devs.
5 people like thisPosted: 4 years ago by Cerberus (FSharp Discord)