Skip to content

Quotation Monad #374

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

Draft
wants to merge 13 commits into
base: master
Choose a base branch
from
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
+ tests
  • Loading branch information
gusty committed Oct 11, 2020
commit ad9cdf0070ab90ac1b28f0781e0b500ef3eb0379
31 changes: 31 additions & 0 deletions tests/FSharpPlus.Tests/Expr.fs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
namespace FSharpPlus.Tests

open System
open NUnit.Framework
open FSharpPlus
open FSharpPlus.Tests.Helpers

module Expr =

let ``Simple quotation combination`` evaluator =
let one = <@ 1 @>
let add10AndToString x =
let a = string (x + 10)
<@ a @>

let expr = one >>= add10AndToString
let res = Expr.run evaluator expr

areEqual "11" res

[<Test>]
let ``Simple quotation combination (QuotationEvaluator)`` () =
``Simple quotation combination`` FSharp.Quotations.Evaluator.QuotationEvaluator.EvaluateUntyped

[<Test>]
let ``Simple quotation combination (Unquote)`` () =
``Simple quotation combination`` Swensen.Unquote.Operators.evalRaw

[<Test>]
let ``Simple quotation combination (PowerPack)`` () =
``Simple quotation combination`` Microsoft.FSharp.Linq.QuotationEvaluator.EvaluateUntyped
8 changes: 8 additions & 0 deletions tests/FSharpPlus.Tests/FSharpPlus.Tests.fsproj
Original file line number Diff line number Diff line change
@@ -15,6 +15,7 @@
<Compile Include="General.fs" />
<Compile Include="Validations.fs" />
<Compile Include="Free.fs" />
<Compile Include="Expr.fs" />
<Compile Include="ComputationExpressions.fs" />
<Compile Include="Lens.fs" />
<Compile Include="Extensions.fs" />
@@ -32,12 +33,19 @@
<ProjectReference Include="..\CSharpLib\CSharpLib.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="FSPowerPack.Linq.Community" Version="3.0.0" />
<PackageReference Include="System.Runtime" Version="4.3.1" />
<PackageReference Include="Unquote" Version="5.0.0" />
<PackageReference Update="FSharp.Core" Version="4.6.2" />
<PackageReference Include="MathNet.Numerics.FSharp" Version="4.8.1" />
<PackageReference Include="NUnit" Version="3.11.0" />
<PackageReference Include="FsCheck" Version="2.14" />
<PackageReference Include="NUnit3TestAdapter" Version="3.11.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.0'">
<PackageReference Include="FSharp.Quotations.Evaluator">
<Version>2.1.0</Version>
</PackageReference>
</ItemGroup>
</Project>