This file contains 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 | |
module Async = | |
let map f workflow = async { let! res = workflow | |
return f res } | |
let bind f workflow = async.Bind(workflow, f) | |
let readInput() = async { return Console.ReadLine() } | |
let random() = async { return System.Random().Next(100) } |
This file contains 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
// Learn more about F# at http://fsharp.org | |
// See the 'F# Tutorial' project for more help. | |
open System | |
module Async = | |
let map f workflow = async { let! res = workflow | |
return f res } | |
let bind f workflow = async.Bind(workflow, f) | |
type FMap = FMap with |
This file contains 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
using Akka; | |
using Akka.Actor; | |
using Akka.Configuration; | |
using Akka.Streams; | |
using Akka.Streams.Dsl; | |
using Akka.Streams.Implementation; | |
using Akka.Streams.Implementation.Stages; | |
using Akka.Streams.Stage; | |
using System; | |
using System.Threading; |
This file contains 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 | |
#if FABLE_COMPILER | |
open Fable.Core | |
open Fable | |
[<Emit("prompt($0,'')")>] | |
let prompt (s1 : string ) : string = jsNative |
This file contains 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
<Project Sdk="Microsoft.NET.Sdk.Razor"> | |
<PropertyGroup> | |
<TargetFramework>netcoreapp3.0</TargetFramework> | |
<AddRazorSupportForMvc>true</AddRazorSupportForMvc> | |
</PropertyGroup> | |
<ItemGroup> | |
<FrameworkReference Include="Microsoft.AspNetCore.App" /> | |
</ItemGroup> |
This file contains 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 Fable | |
open Fable.Core | |
open Fable.Core.JS | |
let parityl( x : uint64 ) = | |
let mutable x = x | |
let mutable result : uint64 = uint64 0 | |
while (x > uint64(0L)) do | |
result <- result + (x &&& uint64 1) | |
x <- (x >>> 1) |
This file contains 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
// Write code or load a sample from sidebar | |
open Fable | |
open Fable.Core | |
open Fable.Core.JS | |
[<AllowNullLiteralAttribute>] | |
type Node<'Key , 'Value when 'Key :> System.IComparable<'Key>>(key: 'Key, value : 'Value , N : int) = | |
member _.Key = key | |
member val Value = value with get, set | |
member val N = N with get, set |
This file contains 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 Fable | |
open Fable.Core | |
open Fable.Core.JS | |
open System | |
[<Emit("prompt($0,'')")>] | |
let prompt (s1 : string) : string = jsNative | |
let input = prompt("hello") |
This file contains 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
let add x y = x + y | |
let inc = add 1 | |
5 |> inc |> printf "%A" | |
printf "%A" <| inc 5 | |
printf "%A" (inc 5) | |
This file contains 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
let mutable cont = true | |
let mutable init = 1001 | |
while cont do | |
if init % 37 = 0 then | |
printf "%i" init | |
cont <- false | |
init <- init + 1 |
OlderNewer