Skip to content

Instantly share code, notes, and snippets.

@atsapura
atsapura / fsharpjobs.md
Created December 20, 2019 10:36 — forked from swlaschin/fsharpjobs.md
My suggestions on how to look for F# jobs

How to find F# jobs

People often ask me how to find F# jobs. I don't have any special connections to companies using F#, and I don't have any special tricks either. I wish I did!

So, given that, here's my take on F# jobs.

Job hunting

For job hunting my suggestions are:

@atsapura
atsapura / fsharpjobs.md
Created December 20, 2019 10:36 — forked from swlaschin/fsharpjobs.md
My suggestions on how to look for F# jobs

How to find F# jobs

People often ask me how to find F# jobs. I don't have any special connections to companies using F#, and I don't have any special tricks either. I wish I did!

So, given that, here's my take on F# jobs.

Job hunting

For job hunting my suggestions are:

@atsapura
atsapura / TryParse.fs
Created October 3, 2019 14:04
TryParse shortcut for Int.TryParse, Guid.TryParse etc.
let inline tryParse<'a when 'a: (static member TryParse: string * byref<'a> -> bool)> x =
let mutable res = Unchecked.defaultof<'a>
if (^a: (static member TryParse: string * byref<'a> -> bool) (x, &res))
then Some res
else None
let a = tryParse<int>("19")
let b = tryParse<Guid>("4A9FA193-26D6-4D21-8610-02B060D43744")
let c = tryParse<DateTimeOffset>("ddd")
[<AutoOpen>]
module PriorityQueue =
[<AutoOpen>]
module private Heap =
type 'a Node =
| Empty
| Node of 'a NodeData
and 'a NodeData =
@atsapura
atsapura / TestInterpreter.fs
Last active June 20, 2019 13:14
Mocking interpreter for testing execution trees
module TestingInterpreter =
open CardManagement
open System
open CardDomain
open CardManagement.Common.Errors
open CardManagement.Common.CommonTypes
open CardManagement.Common.CountryModule
open CardProgramBuilder
open CardManagement.Common
(*
WHAT'S GOING ON HERE?!
Sometimes you don't care about a particular type, you're interested in one field only, let's say `EntityId`.
Instead of using interface (which isn't even possible if don't own a type),
we can do structural typing in F# using SRTP and Active Patterns.
Active patterns are not required for this, but they do make code much easier to use.
*)
// So we have 2 types with field `EntityId: string`: