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
// This is am example of an immediate write / random access cursor for Excel with basic formatting options. | |
// Implementation is based on a concrete, non generic writer monad with no payload ("do!"" only) (only state). | |
// Instead of directl writing to excel, an alternatives would be a random acces to a | |
// copy-on-write list (or even a mutable array) and then bulk-write the result to excel in one shot. | |
// When only forward access would have been required, a simple seq expression with yields would have been enough. | |
// Anyway, it is a demonstration on how to "hide" pseudo-mutable state that is passed through a computation. | |
// | |
// I personally use it for generating reports based on various data sources. |
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
type DifferenceType<'TKey, 'T> = | |
| Added of 'TKey * 'T | |
| Removed of 'TKey * 'T | |
| Modified of 'TKey * 'T * 'T * seq<string * (string * string)> with | |
member this.Key = | |
match this with | |
| Added (key, _) | |
| Removed (key, _) | |
| Modified (key, _, _, _) -> key |
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
# runs tests in parallel | |
TEST_CMD="./build/test/run_unit_tests" | |
JOBS="8" | |
TAGS="$($TEST_CMD -l | grep Scenario -A 1 | grep -v Scenario | sort -u)" | |
IFS=' ' read -a SPLIT <<< $TAGS | |
NUM_TAGS=${#SPLIT[@]} | |
# so as to round up | |
PER_JOB=`expr $NUM_TAGS + $JOBS - 1` |
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
namespace MyNamespace | |
type IMyInterface = | |
abstract GetValue: unit -> string | |
type MyRecord = | |
{ MyField1: int | |
MyField2: string } | |
interface IMyInterface with | |
member x.GetValue() = x.MyField2 |