Skip to content

Commit

Permalink
fix/add type annotations to docs
Browse files Browse the repository at this point in the history
  • Loading branch information
gusty committed Jul 9, 2022
1 parent cdbd9ff commit 17ce830
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions docsrc/content/abstraction-monad.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ let some14 =

(**
```f#
let fn : ResultT<Reader<int,Result<_,string>>> =
let fn : ResultT<string, Reader<int,__>, _> =
monad {
let! x1 = lift ask
let! x2 =
Expand Down Expand Up @@ -183,7 +183,7 @@ let decodeError = function

// Now the following functions compose the Error monad with the Async one.

let getValidPassword : ResultT<_> =
let getValidPassword : ResultT<_, _, _> =
monad {
let! s = liftAsync getLine
if isValid s then return s
Expand Down Expand Up @@ -255,11 +255,11 @@ module CombineReaderWithWriterWithResult =
let! w = eitherConv divide5By 6.0
let! x = eitherConv divide5By 3.0
let! y = eitherConv divide5By 0.0
let! z = eitherConv otherDivide5By 0.0 </catch/> (throw << (fun _ -> "Unknown error"))
let! z = eitherConv otherDivide5By 0.0 </catch/> (throw << (fun (_: unit) -> "Unknown error"))

return (w, x, y, z) }

let run expr = ReaderT.run expr >> ResultT.run >> Writer.run
let run expr = ReaderT.run expr >> ResultT.run >> Writer.run

let (_, log) = run divide DateTime.UtcNow

Expand Down

0 comments on commit 17ce830

Please sign in to comment.