Brought in data model / dependencies

A combination of the previous effort plus a few things swiped from
Quatro
This commit is contained in:
Daniel J. Summers
2016-12-12 22:29:05 -06:00
parent 864777a831
commit da6910e055
7 changed files with 332 additions and 36 deletions

16
src/Extensions.fs Normal file
View File

@@ -0,0 +1,16 @@
[<AutoOpen>]
module MyPrayerJournal.Extensions
open System.Threading.Tasks
// H/T: Suave
type AsyncBuilder with
/// An extension method that overloads the standard 'Bind' of the 'async' builder. The new overload awaits on
/// a standard .NET task
member x.Bind(t : Task<'T>, f:'T -> Async<'R>) : Async<'R> = async.Bind (Async.AwaitTask t, f)
/// An extension method that overloads the standard 'Bind' of the 'async' builder. The new overload awaits on
/// a standard .NET task which does not commpute a value
member x.Bind(t : Task, f : unit -> Async<'R>) : Async<'R> = async.Bind (Async.AwaitTask t, f)
member x.ReturnFrom(t : Task<'T>) : Async<'T> = Async.AwaitTask t