Problem statement - what is the nature of the issue we’re going to try to solve with this specification?
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
#r "nuget: Nito.AsyncEx, 5.1.2" | |
open System.Threading | |
open System.Threading.Tasks | |
open Nito.AsyncEx | |
let work x y = | |
async { | |
do! Async.Sleep 1 | |
return 1 + 2 | |
} |
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 Log = | |
open System | |
open System.IO | |
let private logDir = "logs" | |
let private log kind fmt = | |
Printf.kprintf (fun s -> | |
let now = DateTime.Now | |
let msg = sprintf "[%s] [%s] %s" (now.ToString("s")) kind s |
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
(* | |
F# port of https://github.com/pomber/didact | |
Copyright © 2022 Victor Peter Rouven Müller | |
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | |
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | |
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FRO |
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
// SRTP: Statically Resolved Type Parameters | |
// https://docs.microsoft.com/en-us/dotnet/fsharp/language-reference/generics/statically-resolved-type-parameters | |
// SRTP Allows for pulling members out of types that where the member is named and typed the same | |
// In this example SRTP will be used to pull out the 'First: string' and 'Last: string' members | |
// from different types | |
// One example of SRTP in the F# Base Class Library is the (+) operator. | |
// You'll see that it has this type signature: |
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
// Computations with extensible environment, error handling, and asynchronicity | |
// I recently reviewed some F# code that turned out to be using | |
// | |
// Dependency Interpretation | |
// https://fsharpforfunandprofit.com/posts/dependencies-4/ | |
// | |
// and got thinking about whether one could construct a usable Zio like monad | |
// | |
// https://zio.dev/ |
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
<!-- | |
If no PackageReadmeFile is present and there's a _PackageFiles with the metadata node `PackageReadmeFile="true"` set, | |
use its resolved PackagePath as the `PackageReadmeFile` | |
eg. <None Include="../../README.md" Pack="true" PackagePath="\" PackageReadmeFile="true" /> | |
--> | |
<Target Name="_SetPackageReadmeFileByConvention" | |
DependsOnTargets="_GetPackageFiles" | |
BeforeTargets="GenerateNuspec" | |
Condition="'$(PackageReadmeFile)' == ''"> |
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
<Project> | |
<PropertyGroup> | |
<!-- Provide an escape hatch/opt-in to this feature --> | |
<AutoIncludeExistingSignatures Condition="$(AutoIncludeExistingSignatures) == '' " >false</AutoIncludeExistingSignatures> | |
</PropertyGroup> | |
<Target Name="CollectFSharpSourcesAndSignatures" BeforeTargets="CoreCompile" Condition="$(AutoIncludeExistingSignatures)"> | |
<ItemGroup> | |
<!-- Cache the current set of compile options --> | |
<_Sources Include="@(Compile)" /> | |
<!-- clear out the Compile order because we need to insert the sigs before their associated source files --> |
title | author | date | source | snippet | gist |
---|---|---|---|---|---|
MSBuild Version Properties Cheatsheet |
natemcmaster |
September 18, 2019 |
Based on Stack Overflow