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
const jsc = require("jsverify"); | |
const _ = require("lodash"); | |
const add = (a, b) => a + b; | |
const mult = (a, b) => a * b; | |
const sub = (a, b) => a - b; | |
const addIsCommunicative = jsc.checkForall( | |
jsc.integer, | |
jsc.integer, |
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
public void Calc() | |
{ | |
var lists = new List<List<int>> | |
{ | |
new List<int> { 1, 1, 2, 2 }, | |
new List<int> { 1, 1, 1, 1 }, | |
new List<int> { 1, 2, 3, 4 }, | |
new List<int> { 9, 1, 2, 1, 2, 9 } | |
}; |
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
#r "packages/Hopac/lib/net45/Hopac.Core.dll" | |
#r "packages/Hopac/lib/net45/Hopac.Platform.dll" | |
#r "packages/Hopac/lib/net45/Hopac.dll" | |
open Hopac | |
open Hopac.Infixes | |
type Delkrav = { | |
DelkravId : int | |
Delkravsnamn : string |
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
#r "packages/Hopac/lib/net45/Hopac.dll" | |
#r "packages/Hopac/lib/net45/Hopac.Core.dll" | |
#r "packages/Hopac/lib/net45/Hopac.Platform.dll" | |
#r "packages/FSharp.Data/lib/net45/FSharp.Data.dll" | |
#r "packages/Http.fs/lib/net461/HttpFs.dll" | |
#r "packages/System.Net.Http/lib/net46/System.Net.Http.dll" | |
open Hopac | |
open Hopac.Infixes | |
open FSharp.Data |
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
def get_request id do | |
:timer.sleep(:rand.uniform(10000)) | |
IO.puts "#{id} klar" | |
end | |
def run_normal do | |
Enum.map(1..10_000, &get_request(&1)) | |
end | |
def run_async do |
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
public enum Målstatus | |
{ | |
Nytt, | |
Diariefört, | |
Gallrat, | |
Avlutat | |
} | |
public interface IMål | |
{ |
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 System; | |
using System.Collections.Generic; | |
using System.Linq; | |
namespace ParserCombinator | |
{ | |
public class Result<T, U> | |
{ | |
public U Value { get; private 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
// Okej nu behöver vi lite typer | |
interface Success<T> { | |
kind: "success"; | |
val: [T[], string]; | |
} | |
interface Failure { | |
kind: "failure"; | |
message: string; | |
} |
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
public static OrignalAdress ParseLine(string str) | |
{ | |
var separator = Parse.String(","); | |
var quote = Parse.Char('\''); | |
var parsaNull = Parse.String("null").Return("null"); | |
var parsaVärde = from open in quote | |
from content in Parse.AnyChar.Except(quote).Many() | |
from close in quote |
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
interface IBase { | |
nånProp: string; | |
} | |
interface IFirst extends IBase { | |
fulProp: string; | |
} | |
interface ISecond extends IBase { | |
FulProp: string; |