Skip to content

Commit

Permalink
Indent (net8)
Browse files Browse the repository at this point in the history
  • Loading branch information
wallymathieu committed Oct 15, 2023
1 parent 56fc6fe commit 3200dcd
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions docsrc/content/tutorial.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,25 +104,25 @@ But don't forget the above used operators are generic, so we can change the type
(*** hide ***)
module E2 =

let tryParseInt x : Choice<int, string> =
match tryParse x with
| Some x -> Choice1Of2 x
| None -> Choice2Of2 ("Failed to parse " + x)

let tryParseInt x : Choice<int, string> =
match tryParse x with
| Some x -> Choice1Of2 x
| None -> Choice2Of2 ("Failed to parse " + x)

let tryDivide x n =
if n = 0 then Choice2Of2 "Can't divide by zero"
else Choice1Of2 (x / n)
let tryDivide x n =
if n = 0 then Choice2Of2 "Can't divide by zero"
else Choice1Of2 (x / n)

(**
The test code remains unchanged, but we get a more interesting functionality
*)
(**
The test code remains unchanged, but we get a more interesting functionality
*)

let parseAndDivide100By = tryParseInt >=> tryDivide 100
let parseAndDivide100By = tryParseInt >=> tryDivide 100

let parsedAndDivide100By20 = parseAndDivide100By "20" // Choice1Of2 5
let parsedAndDivide100By0' = parseAndDivide100By "zero" // Choice2Of2 "Failed to parse zero"
let parsedAndDivide100By0 = parseAndDivide100By "0" // Choice2Of2 "Can't divide by zero"
let parsedAndDivide100By20 = parseAndDivide100By "20" // Choice1Of2 5
let parsedAndDivide100By0' = parseAndDivide100By "zero" // Choice2Of2 "Failed to parse zero"
let parsedAndDivide100By0 = parseAndDivide100By "0" // Choice2Of2 "Can't divide by zero"


(**
Expand Down

0 comments on commit 3200dcd

Please sign in to comment.