Last active
December 30, 2020 15:44
-
-
Save swlaschin/d35b59795a85a62723124df1a79d2388 to your computer and use it in GitHub Desktop.
Code examples from fsharpforfunandprofit.com/posts/dependencies/
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
(* =================================== | |
Code from my series of posts "Six approaches to dependency injection" | |
=================================== *) | |
open System | |
(* ====================================================================== | |
1. Dependency Retention | |
In which we don't worry about managing dependencies, | |
and just inline and hard-code everything! | |
====================================================================== *) | |
let compareTwoStrings() = | |
printfn "Enter the first value" | |
let str1 = Console.ReadLine() | |
printfn "Enter the second value" | |
let str2 = Console.ReadLine() | |
if str1 > str2 then | |
printfn "The first value is bigger" | |
else if str1 < str2 then | |
printfn "The first value is smaller" | |
else | |
printfn "The values are equal" | |
// The only way to test this is manually | |
(* | |
compareTwoStrings() | |
*) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment