- Linkdump for the code katas workshop by quality @ speed and ae.
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
//https://fsprojects.github.io/SwaggerProvider/#/ | |
(* | |
#r "nuget: SwaggerProvider, Version=2.0.0-beta9" | |
*) | |
open SwaggerProvider | |
open System | |
open System.Net.Http | |
type PetStore = OpenApiClientProvider<"https://petstore3.swagger.io/api/v3/openapi.json"> |
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
//Inspired on "How to specify it!" by John Hughes (& Java adaptation by Johannes Link) | |
//https://johanneslink.net/how-to-specify-it/ | |
#r "nuget: fscheck" | |
open FsCheck | |
module BST = | |
type BinarySearchTree<'v> = | |
| Empty | |
| Node of |
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 "nuget: FsCheck, version=3.0.0-beta1" | |
open FsCheck | |
open FsCheck.FSharp | |
let revRev xs = xs |> List.rev |> List.rev = xs | |
Check.QuickThrowOnFailure revRev | |
type Tree<'a> = Branch of Tree<'a> * Tree<'a> | Leaf of 'a |
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.Threading.Tasks; | |
using LanguageExt; | |
using Xunit; | |
namespace LanguageExtDemo | |
{ | |
public class Repository | |
{ | |
public OptionAsync<string> GetName(int id) |
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; | |
using FluentAssertions; | |
using Xunit; | |
using LanguageExt; | |
using static LanguageExt.Prelude; | |
namespace LanguageExtDemo | |
{ |
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 @"C:\Code\SharpVG\SharpVG\bin\Debug\netstandard2.1\SharpVG.dll" | |
#r @"C:\NugetLocal\netstandard\build\net461\lib\netstandard.dll" | |
open SharpVG | |
let black = Color.ofName Black | |
let opaque = 1.0 | |
let style = Style.create black black Length.one opaque opaque | |
let lineAt p1 p2 = Line.create (Point.ofInts p1) (Point.ofInts p2) |> Element.create |> Element.withStyle style |
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 @"C:\NugetLocal\FsCheck.2.4.0\lib\net45\FsCheck.dll" | |
open FsCheck | |
//Simple property | |
let reversingAReversedList l = List.rev (List.rev l) = l | |
Check.Quick reversingAReversedList | |
//Failing property: example of standard shrinking | |
let reversingAList l = (List.rev l) = l | |
Check.Quick reversingAList |
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
%load a prolog file like [this]. | |
%or just send file to REPL | |
%Peano arithmetic | |
% https://en.wikipedia.org/wiki/Peano_axioms | |
% * 0 is a natural number | |
% * if n is a natural number, s(n) is a natural number | |
% * equality | |
% * 0 = 0 | |
% * a = b -> s(a) = s(b) |
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
[TestClass] | |
public class WhenTargetContractDoesNotCorrespondToSourceContractOtherFirmnessLevel : GivenRulesDeterminedFromDatabaseConfiguredRules | |
{ | |
private ICapacityConversionRequest capacityConversionRequest; | |
private IRepository<ITransmissionService> transmissionServiceRepository; | |
private void GivenParameters() | |
{ | |
this.capacityConversionRequest = MockRepository.GenerateStub<ICapacityConversionRequest>(); |
NewerOlder