Cool new stream about F# from LaylaCodesIt

There was a cool new series about F# on Twitch today.  It was fun to see and I haven't used F# in a long time. I felt like it was my first time while watching the stream.

https://www.twitch.tv/laylacodesit 




Here is my code inspired by Layla and Alyssa.


or if you want the whole project...


It just reads from a text file and prints the contents out to the console.

// For more information see https://aka.ms/fsharp-console-apps
printfn "Console App: Started!"

open System.IO
let baseDirectory = __SOURCE_DIRECTORY__
let filePath = "Text.txt"
let fullPath = Path.Combine(baseDirectory, filePath)

let readFilesTask (path1) =
  task {
    let! content = File.ReadAllTextAsync(path1)
    return content
  }

printfn "Content: %s" (readFilesTask(fullPath).Result)

Comments

Popular posts from this blog

Special Characters are Truly Special

.NET Maui and VS Code

Where’s my phone update?