This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
open System.Threading.Tasks | |
open FSharp.Control.Tasks.V2 | |
[<RequireQualifiedAccess>] | |
[<CompilationRepresentation(CompilationRepresentationFlags.ModuleSuffix)>] | |
module Lazy = | |
let map (fn : 'T -> 'U) (x : Lazy<'T>) = | |
Lazy.Create(fun () -> fn x.Value) | |
[<Struct>] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// The MIT License (MIT) | |
/// Copyright (c) 2016 Bazinga Technologies Inc | |
module FSharp.Data.GraphQL.Validation.Ast | |
open FSharp.Data.GraphQL.Types | |
open FSharp.Data.GraphQL.Introspection | |
type ValidationTypeRef = | |
| NonNull of ValidationTypeRef |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[<Sealed>] | |
type IDictionaryConverter() = | |
inherit JsonConverter() | |
let fail() = raise <| JsonSerializationException("Unexpected end when reading a JSON object into an IDictionary<string, object>.") | |
let rec writeObject (writer : JsonWriter) (value : obj) = | |
writer.WriteStartObject() | |
value :?> IDictionary<string, obj> | |
|> Seq.iter (fun kvp -> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
open FSharp.Data.GraphQL | |
type MyProvider = GraphQLProvider<"http://localhost:8084"> | |
[<EntryPoint>] | |
let main _ = | |
let ball = MyProvider.Types.Ball(form = "Spheric", format = "Spheric", id = "1") | |
let box = MyProvider.Types.Box(form = "Cubic", format = "Cubic", id = "2") | |
let things : MyProvider.Types.IThing list = [ball; box] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
open System.Reactive.Linq | |
open System | |
/// Extended operations on observable objects. | |
[<RequireQualifiedAccess>] | |
module Observable = | |
/// Binds an observable sequence using the provided binder function to produce a new observable. | |
let bind (binder : 'a -> IObservable<'b>) x = Observable.SelectMany(x, binder) | |
/// Creates an observable sequence from an asynchronous computation. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
open Microsoft.FSharp.Control | |
open System.Collections.Generic | |
open System.Reactive.Linq | |
/// A struct used to operate on both synchornous values and asynchronous computations. | |
/// Can hold computation failures as exceptions as well. | |
type AsyncVal<'a> = | |
/// Represents a synchronous value. | |
| Value of 'a | |
/// Represents an asynchronous computation. |