Skip to content

Instantly share code, notes, and snippets.

type Claim = { Name: string; Value: string }
type Mapping = { Group: string; Roles: string list }
let mapping = [
{ Group = "aaa"; Roles = [ "Admin" ] }
{ Group = "ccc"; Roles = [ "King" ] }
{ Group = "uuu"; Roles = [ "User" ] }
]
// Inferred return type: `'a list`
let implicitYield (f: int -> unit) = [
for i in 0 .. 3 do
if i = 2 then f i
else printf "Not 2"
]
// Inferred return type: `unit list`
let explicitYield (f: int -> unit) = [
for i in 0 .. 3 do
@ArtemyB
ArtemyB / ArangoDBNetStandard_FSharpSystemTextJson.fs
Last active September 27, 2022 18:37
System.Text.Json-based F#-friendly serialization configuration for ArangoDBNetStandard
module ArangoDBNetStandardFSharpSystemTextJsonSerialization
open System
open System.IO
module SystemTextJson =
open System.Text.Json
open System.Text.Json.Serialization
@ArtemyB
ArtemyB / ImplementInterfaceWithOverloadedMethod.fsx
Created November 15, 2018 08:12
Implementing interface with overloaded method in F#
type IAbcd<'A, 'B> =
abstract member TheMethod : 'A * int -> 'B
abstract member TheMethod : 'A * string -> 'B
type Abcd<'A>() =
member x.TheMethod(a: 'A, i: int) =
printfn "%i" i
member x.TheMethod(a: 'A, s: string) =
@ArtemyB
ArtemyB / Set10.csv
Created December 2, 2016 12:56
New-Hampshire granite radioactivity level depending on the degree of weathering. VAR1 - granite type (1 - green, 2 - red); VAR2 - radioactivity level of weathered granite; VAR3 - radioactivity level of fresh granite
VAR1 VAR2 VAR3
1 909 710
1 918 754
1 799 712
1 831 750
1 762 713
1 716 767
1 801 715
1 760 700
1 806 724
@ArtemyB
ArtemyB / Set10.csv
Created December 2, 2016 12:56
New-Hampshire granite radioactivity level depending on the degree of weathering.VAR1 - granite type (1 - green, 2 - red); VAR2 - radioactivity level of weathered granite; VAR3 - radioactivity level of fresh granite
1 909 710
1 918 754
1 799 712
1 831 750
1 762 713
1 716 767
1 801 715
1 760 700
1 806 724
// Для абсолютного понятия:
absolute_concept
=> nrel_main_idtf:
[absolute concept](*<- lang_en;;*);
[абсолютное понятия](*<- lang_ru;;*);
<- rrel_key_sc_element:...
(*
<- sc_definition;;
=> nrel_main_idtf: [Definition (absolute concept)](*<- lang_en;;*);;
=> nrel_main_idtf: [Определение (абсолютное понятие)](*<- lang_ru;;*);;
@ArtemyB
ArtemyB / xy.csv
Last active October 26, 2016 11:49
Just data for plot
x y
0 0.3486784401
1 0.7360989291
1 0.7360989291
2 0.9298091736
2 0.9298091736
2 0.9298091736
2 0.9298091736
3 0.9872048016
3 0.9872048016
// Объявляем sc-агент поисковой операции
sc_agent_of_search_operation
// Указываем множество идентификаторов агента
=>nrel_main_idtf:
// lang_ru – атрибут идентификатора на русском языке
[sc-агентпоиска] (* <- lang_ru;; *);
// lang_en – атрибут идентификатора на английском языке
[sc-agent of search] (* <- lang_en;; *);
// Указываем, что наш агент принадлежит классу абстрактныхsc-агентов
<- abstract_sc_agent;