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
// Calculates the cost of an Azure Container Instances container | |
// Using the default Linux container with 1 vCpu and 1.5GB vRAM | |
[<Measure>] type gb | |
[<Measure>] type core | |
[<Measure>] type gbp | |
[<AutoOpen>] | |
module Time = | |
[<Measure>] type sec |
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
open System.IO | |
type FolderStatistic = { Name : string | |
Size : int64 } | |
let calculateFolderSize (folder : string) = | |
folder | |
|> Directory.GetFiles | |
|> Array.sumBy (fun file -> (FileInfo file).Length) | |
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
// F# version of https://twitter.com/gsferreira/status/1516827091127394309/ | |
open System | |
open System.IO | |
type PotentialProcessingError = StringMissing | StringTooShort | |
let application (str: string) = | |
match str with | |
| str when str.Length < 5 -> Error StringTooShort |