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
open System | |
[<EntryPoint>] | |
let main argv = | |
let result = Result.Ok "Hello" | |
printfn "%A" result | |
0 | |
// Instructions: | |
// Create an F# project, add latest FSharp.Core package using NuGet or Paket. |
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 "../src/Akkling/bin/Debug/Akka.dll" | |
#r "../src/Akkling/bin/Debug/Akkling.dll" | |
open System | |
open Akkling | |
open Akka.Actor | |
let system = System.create "basic-sys" <| Configuration.defaultConfig() | |
let untypedActor (m:Actor<_>) = |
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
1. Yaml configuration section | |
<?xml version="1.0" encoding="utf-8"?> | |
<akka.persistence> | |
<hocon> | |
<![CDATA[ | |
akka { | |
persistence{ | |
query.journal.sql { | |
max-buffer-size = 10000 |
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 GuaranteedDelivery = | |
open Akka.Actor | |
open Akka.Persistence | |
open Akkling | |
open Akkling.Persistence | |
type Payload = string | |
type DeliveryEnvelope = { Payload: Payload; DeliveryId: int64 } |
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 SocketServer | |
open System | |
open System.IO | |
open Microsoft.AspNetCore.Http | |
open Giraffe | |
open Elmish | |
open Elmish.Bridge | |
open Thoth.Json.Net |
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
let expenses = [ | |
1768 | |
1847 | |
1905 | |
1713 | |
1826 | |
1846 | |
1824 | |
1976 | |
1687 |
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
open System | |
let text = """ | |
15-16 l: klfbblslvjclmlnqklvg | |
6-13 h: pghjchdxhnjhjd | |
4-13 n: nnznntzznqnzbtzj | |
10-16 r: nrrrrkrjtxwrrrwx | |
1-6 t: rttftttttttttmdttttt | |
4-12 l: zhllfxlmvqtnhx | |
6-8 d: wxpwgdbjtffddkb |
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
open System | |
open System.IO | |
let area = | |
File.ReadAllLines("input03.txt") | |
|> Array.filter (not << String.IsNullOrEmpty) | |
|> Array.map Seq.toArray | |
|> Array.map (fun line -> line |> Array.map (fun x -> if x = '#' then 1 else 0)) | |
let rec go steps (area : (int array) array) current_pos count = |
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
open System | |
open System.IO | |
let input = | |
File.ReadAllLines("input04.txt") | |
|> Seq.toList | |
let expected_fields_without_country = ["byr"; "iyr"; "eyr"; "hgt"; "hcl"; "ecl"; "pid"] |> Set.ofList | |
let expected_fields = expected_fields_without_country |> Set.add "cid" |
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
open System | |
open System.IO | |
let input = | |
File.ReadAllLines("input05.txt") | |
|> Seq.toList | |
|> Seq.filter (not << String.IsNullOrEmpty) | |
let getPosition nums = nums |> List.fold (fun (acc, n) x -> acc + x * n, n * 2) (0, 1) |> fst |