Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Improved Fsharp integration #462

Closed
wants to merge 34 commits into from

4 participants

Colin ravendb Ayende Rahien jalchr
Colin

Hi,

I have added a library Raven.Client.Lightweight.FSharp.

Essentially it adds a set of combinators over the existing client API and a computation expression builder, mainly for syntactic sugar.

There are a couple of points,

  • A dependency on FSharp.Powerpack.Linq.Fixed exists because support for linq expressions is somewhat ropey in F#, this improves in F# 3.0, so it is only for < .NET 4

  • I have tried to bring the tests inline in the same way as the rest of the raven solution

  • I realise that I don't have 100% coverage of all the features, I have just gone with the stuff that I use most often. And due to the lack of support for Linq expressions , c# is still needed to define indexes.

Let me know what you think. I can be contacted directly on twitter via @colinbul

Cheers

Colin

ravendb
Owner
Colin

Hi,

No, I will sign and send it to you tomorrow. Is there anything else you need?

Cheers

Colin.

ravendb
Owner
Colin

Send it to ayende email address

Ayende Rahien
Collaborator

storeImmediate, queryAllBy, queryAll, deleteImmediate, deleteMany, storeMany need to be removed.
They are violating some basic assumptions and best practices.

I also don't understand the Raven.docStoreMap
Why do you need to manage it in this fashion?

Colin
Ayende Rahien
Collaborator
Colin
Colin Added raven computation expression tests and a more complete expressi…
…on builder i.e. Now supports For, try/catch try/finally while ect. Also removed the combinators made bad assumptions under ayende's suggestion
7347173
Colin

Ok, I have completed the changes we discussed earlier. I have also added more complete support and tests for the computational workflow syntax, this now supports things like

  • Try/Catch
  • Try/Finally
  • use and use!
  • Iteration like while and for

Cheers

Colin

Ayende Rahien
Collaborator

Why is there:

  • include
  • Is there a reason not to do implicit do! saveChanges at the end of the raven {} block?
Ayende Rahien
Collaborator

I meant include in quotes?

Colin
Colin

Oh, hold on, I think I see what you mean now.. so the

raven {} is like a discrete set of operations and if it all completes without exception then call save changes?

Ayende Rahien
Collaborator
Colin

Yeah, including is good... That is actually what I had it as originally but I changed it to be more in line with the Raven API.

I'll get on to this later on tonight.

Cheers

Colin

OK, have committed the changes you requested let me know if there is anything else

Ayende Rahien
Collaborator
Colin

Hi,

I have just removed FSUnit and Updated the xUnit version to 1.9,

Experienced some oddities, thou with the upgrade for some reason the Assert.Equal was not selecting the correct overload, I guess this is something to do with the type inference. So in a few tests I have had to use Assert.True(expected = actual).

Ayende Rahien
Collaborator

Colin,
Thanks so much, I pulled your changes in.
Would you be able to write the docs for this as well?

Ayende Rahien ayende closed this March 04, 2012
Colin

Not a problem..

Where do I include the docs?

Ayende Rahien
Collaborator
Colin

About the documentation,

F# projects do not support regions which seems to be how you are selecting the code samples in your documentation...

Will just embedding the code samples in the documentation suffice?

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

Showing 34 unique commits by 5 authors.

Feb 25, 2012
Colin Added a more idiomatic API for using raven from fsharp b1f5021
Colin Added a test for luceneQueries and query composition 71f3765
Colin Added a test for luceneQueries and query composition b3f1b0a
Colin moved tests inline for rest of Raven solution 9886c18
Feb 27, 2012
Colin Added raven computation expression tests and a more complete expressi…
…on builder i.e. Now supports For, try/catch try/finally while ect. Also removed the combinators made bad assumptions under ayende's suggestion
7347173
Feb 28, 2012
jalchr A Failing Test 2106c20
Ayende Rahien Fixing pre-mature expiration of subscription licenses 80bf2aa
Ayende Rahien making sure that we aren't limited to 25 databases 3434601
Ayende Rahien Adding support for NOT using Search 17c094d
Ayende Rahien Fixing build on 3.5 72e539c
Ayende Rahien Adding passing tests 5c3925f
Ayende Rahien Merge branch 'master' of https://github.com/jalchr/ravendb 4daae91
Ayende Rahien Fixing test b01e57c
Ayende Rahien spaces -> tabs 61e1395
Ayende Rahien Fixing the build for StressTest failing because of the NLog.dll from SL 2909c4d
Ayende Rahien Merge branch 'master' of https://github.com/fitzchak/ravendb
Conflicts:
	default.ps1
9bf9bb9
Ayende Rahien Moving very slow tests to the stress test project 6248e02
Feb 29, 2012
Ayende Rahien Making sure that _ is noted as a dynamic indexing for sorting as well 47a02ea
Ayende Rahien Don't run stress & performance tests on every build ad6e6a8
Ayende Rahien Adding passing tests b182f40
Ayende Rahien Use the proper configuration variable name cd1a62c
Colin Changed include to including, and made run call saveChanges implicitl…
…y if the computation does not error
c5aa16f
Mar 01, 2012
Fixed localization issue in test 68cd799
Mar 02, 2012
Ayende Rahien Better source path for the start script, will use the current batch f…
…ile location, instead of the current directory
bec0810
Ayende Rahien Fixing wrong variable returned in .NET 3.5 a285bb8
Ayende Rahien spaces -> tabs 4867233
Ayende Rahien Merge branch 'master' of https://github.com/colinbull/ravendb
Conflicts:
	RavenDB.sln
5b03b1b
Ayende Rahien Including FsLinqFixed in the acknowledgments file bb3ca1f
Ayende Rahien Fixing build 44c4d45
Ayende Rahien Avoiding unnecessary copying 15e707d
Ayende Rahien Fixing test that didn't wait for stale results 215c41b
Ayende Rahien Fixing an issue where delete would use the string id and not be part …
…of the unit of work
398e7b1
Ayende Rahien Adding F# to the build output df9b810
Colin Removed dependency on FSUnit and updated to run on Xunit 1.9 24d857c
Something went wrong with that request. Please try again.