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
module MergeSort | |
let sortBy cmp xs = | |
let rec sequences xs = | |
match xs with | |
| a :: b :: xs -> | |
if cmp a b > 0 | |
then descending b [a] xs | |
else ascending b (fun ys -> a :: ys) xs | |
| xs -> [xs] |
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
// Issue decribed here: http://websharper.com/question/82758/post-endpoint-with-a-json-body-cannot-be-reached | |
namespace HelloWebSharper | |
open WebSharper.Html.Server | |
open WebSharper | |
open WebSharper.Sitelets | |
module Site = |
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
(* | |
# Setup.fsx | |
Adds registry keys for proper F# Web project support. | |
**Problem**: pure-F# Web projects do not work well in Visual Studio by default, | |
in particular adding a new item to the project is not possible. | |
**Solution**: This will hopefully be addressed in future VS versions. |
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 WebSharper | |
open WebSharper.JavaScript | |
open WebSharper.UI.Next | |
open WebSharper.UI.Next.Client | |
open WebSharper.UI.Next.Html | |
open WebSharper.UI.Next.Notation | |
[<JavaScript>] | |
module Client = |
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
namespace Sample | |
open WebSharper | |
open WebSharper.JavaScript | |
open WebSharper.UI | |
open WebSharper.UI.Client | |
open WebSharper.UI.Html | |
open WebSharper.Highcharts | |
open WebSharper.JQuery |
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
type User = { name: string; (* ... *) } | |
type UserId = int | |
type EndPoint<_> = | |
| [<EndPoint "GET /user/{id}">] | |
GetUser : id: UserId -> EndPoint<Json<User>> | |
| [<EndPoint "POST /user"; Json "userData">] | |
CreateUser : userData: User -> EndPoint<Json<UserId>> |
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
<?xml version="1.0" encoding="utf-8"?> | |
<Project> | |
<!-- | |
Override NuGet (or Paket) references with a set of local projects. | |
Usage: | |
* Add this file at the root above all your projects, so that they all gain the capability to override a package. | |
* In a solution where you want to override a package, add a file Directory.Build.props like the following: | |
<?xml version="1.0" encoding="utf-8"?> | |
<Project> |
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
namespace Avalonia.Media.TextFormatting.Unicode | |
open Avalonia.Utility | |
[<Struct; IsByRefLike>] | |
type CodepointEnumerator(text: ReadOnlySlice<char>) = | |
let mutable text = text | |
let mutable current = Codepoint.ReplacementCodepoint |
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
namespace Avalonia.Media.TextFormatting.Unicode | |
open Avalonia.Utility | |
[<Struct; IsByRefLike>] | |
type CodepointEnumerator = | |
val mutable text : ReadOnlySlice<char> | |
val mutable current : Codepoint |
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.Text.Json | |
open System.Text.Json.Serialization | |
open BenchmarkDotNet.Attributes | |
open BenchmarkDotNet.Running | |
type MyRecord = | |
{ | |
x: int | |
y: string | |
} |