This was taken from http://rxwiki.wikidot.com/101samples, because I wanted to be able to read it more comfortable with syntax highlighting.
Here's the unedited original, translated to Github Markdown glory:
namespace TestProvider.Provided | |
open System.Reflection | |
open FSharp.Core.CompilerServices | |
open ProviderImplementation.ProvidedTypes | |
open System.Collections.Generic | |
open Microsoft.FSharp.Quotations | |
[<TypeProvider>] | |
type SampleProvider(config) as this = |
// make sure codegen.py (https://github.com/CensoredUsername/codegen/blob/master/codegen.py) is in the same folder | |
// and you've added the IronPython package | |
open System.IO | |
open IronPython.Hosting | |
open IronPython.Runtime | |
open Microsoft.FSharp.Reflection | |
let engine = Python.CreateEngine() |
namespace PureDI | |
open Microsoft.AspNetCore.Builder | |
open Microsoft.Extensions.Configuration | |
open Microsoft.Extensions.DependencyInjection | |
open Microsoft.AspNetCore.Mvc | |
open Microsoft.AspNetCore.Mvc.Controllers | |
open Microsoft.Extensions.Logging | |
open Microsoft.AspNetCore | |
open Microsoft.AspNetCore.Hosting |
This was taken from http://rxwiki.wikidot.com/101samples, because I wanted to be able to read it more comfortable with syntax highlighting.
Here's the unedited original, translated to Github Markdown glory:
namespace System.Text.Json | |
open System | |
open System.Collections.Generic | |
open System.Text.Json.Serialization | |
// Converts Option<T> to/from JSON by projecting to null or T | |
type OptionValueConverter<'T>() = | |
inherit JsonConverter<'T option>() |
I suggest that you create one or more Api.fs
files to expose F# code in a C# friendly way.
In this file:
PascalCase
names. They will appear to C# as static methods.Coroutines or async/await is not a new concept as it was named in 1958 by Melvin Conway. Coroutines had support in languages such as Simula(1962), Smalltalk(1972) and Modula-2(1978) but I think one can argue that coroutines came into mainstream with C# 5(2012) when Microsoft added async/await to C#.
A thread can only execute a single subroutine at a time as a subroutine starts and then runs to completion. In a server environment subroutines can be problematic as in order to service connections concurrently we would usually would start a thread per connection, this was the idiom a few years ago. A thread depending on the operating system and settings needs about 1 MiB of user stack space meaning 1,024 threads needs 1 GiB of for just user stack space. In addition there's the cost of kernel stack space, book-keeping and scheduling of threads. This drives cost of VM/hardwa
Download the full version from https://mega.nz/#!7kJCBCpL!Ay4lfoUvshqDIM6dRh0oGCtihlxcY0lO-IDNDcMyi-A | |
{ | |
"swagger": "2.0", | |
"info": { | |
"title": "ElasticSearch", | |
"description": "ACPaaS ElasticSearch Logging Engine API.", | |
"termsOfService": "?", | |
"contact": { |