Skip to content

Commit

Permalink
added newlines and extracted try-with into function
Browse files Browse the repository at this point in the history
  • Loading branch information
TysonMN committed Sep 10, 2021
1 parent 5c49a9e commit 184b321
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/Hedgehog/Property.fs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,15 @@ module Property =
(Journal.singletonMessage (string e), Failure) |> Gen.constant

let bind (k : 'a -> Property<'b>) (m : Property<'a>) : Property<'b> =
m |> toGen |> bindGen (fun a -> (try k a |> toGen with e -> handle e)) |> ofGen
let kTry a =
try
k a |> toGen
with e ->
handle e
m
|> toGen
|> bindGen kTry
|> ofGen

let private printValue (value) : string =
// sprintf "%A" is not prepared for printing ResizeArray<_> (C# List<T>) so we prepare the value instead
Expand Down

0 comments on commit 184b321

Please sign in to comment.