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
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
(* | |
# 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
// 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
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
namespace TestLensMacro | |
open WebSharper | |
open WebSharper.JavaScript | |
open WebSharper.JQuery | |
open WebSharper.UI.Next | |
open WebSharper.UI.Next.Client | |
module Extensions = | |
module M = WebSharper.Core.Macros |
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 Example1 | |
open WebSharper | |
open WebSharper.UI.Next | |
open WebSharper.UI.Next.Html | |
open WebSharper.UI.Next.Client | |
[<JavaScript>] | |
module Counter = |
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 Example1 | |
open WebSharper | |
open WebSharper.UI.Next | |
open WebSharper.UI.Next.Html | |
open WebSharper.UI.Next.Client | |
[<JavaScript>] | |
module Counter = |
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
// NuGet reference: WebSharper.Compiler | |
open WebSharper | |
type AR = IntelliFactory.Core.AssemblyResolution.AssemblyResolver | |
module FE = WebSharper.Compiler.FrontEnd | |
let compile (expr: Microsoft.FSharp.Quotations.Expr) : string option = | |
let loader = FE.Loader.Create (AR.Create()) (eprintfn "%O") | |
let options = | |
{ FE.Options.Default with |
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
let mutable result = Unchecked.defaultof< ^a> | |
let success = Int32.TryParse("12", &result) | |
// can be written as: | |
let success, result = Int32.TryParse("12") |