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
{ | |
search(query: "language:F# stars:>10 pushed:>=2020-01-01", type: REPOSITORY, first: 100) { | |
repositoryCount | |
edges { | |
node { | |
... on Repository { | |
nameWithOwner | |
stargazers { | |
totalCount | |
} |
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
//Builder represeting only one entity in DSL | |
type Child1State = {SomeState : string} | |
type Child1Builder () = | |
[<CustomOperation("set_state")>] | |
member __.SetState (st, x) = {st with SomeState = x} |
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
var main = require("../output/Main/index.js"); | |
module.exports = async function (context, req) { | |
context.log('JavaScript HTTP trigger function processed a request.'); | |
context.log(main); | |
let resp = main.answer(999); | |
context.res = { | |
// status: 200, /* Defaults to 200 */ | |
body: "Answer is " + resp | |
}; |
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
module Main where | |
import Prelude | |
import Data.List (range, filter, List) | |
import Data.Foldable (sum) | |
ns :: Int -> List Int | |
ns max = range 0 999 |
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 | |
open System | |
let x = None | |
[<EntryPoint>] | |
let main argv = | |
x.Value | |
printfn "Hello World from F#!" |
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
// [ Analyzers Group ] | |
group Analyzers | |
source https://api.nuget.org/v3/index.json | |
nuget FSharp.Analyzers.Sample 1.0.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
[<Analyzer>] | |
let optionValueAnalyzer : Analyzer = | |
fun ctx -> | |
let state = ResizeArray<range>() | |
let handler (range: range) (m: FSharpMemberOrFunctionOrValue) = | |
let name = String.Join(".", m.DeclaringEntity.Value.FullName, m.DisplayName) | |
if name = "Microsoft.FSharp.Core.FSharpOption`1.Value" then | |
state.Add range | |
ctx.TypedTree.Declarations |> List.iter (visitDeclaration handler) | |
state |
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 rec visitExpr memberCallHandler (e:FSharpExpr) = | |
match e with | |
| BasicPatterns.AddressOf(lvalueExpr) -> | |
visitExpr memberCallHandler lvalueExpr | |
| BasicPatterns.AddressSet(lvalueExpr, rvalueExpr) -> | |
visitExpr memberCallHandler lvalueExpr; visitExpr memberCallHandler rvalueExpr | |
| BasicPatterns.Application(funcExpr, typeArgs, argExprs) -> | |
visitExpr memberCallHandler funcExpr; visitExprs memberCallHandler argExprs | |
| BasicPatterns.Call(objExprOpt, memberOrFunc, typeArgs1, typeArgs2, argExprs) -> | |
memberCallHandler e.Range memberOrFunc |
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
module UserViews | |
open Giraffe.GiraffeViewEngine | |
module AdminPage = | |
let view = [ | |
h1 [] [rawText "I'm admin"] | |
] | |
let layout = App.layout view |
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
module Router | |
open Saturn | |
open Giraffe.Core | |
open Giraffe.ResponseWriters | |
open Users | |
let browser = pipeline { | |
plug acceptHtml |
NewerOlder