Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Utilize Property.set internally #363

Merged
1 commit merged into from
Sep 21, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Hedgehog/Property.fs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ module Property =
let h = g |> Gen.map |> mapGen
h x

let private set (a: 'a) (property : Property<'b>) : Property<'a> =
let internal set (a: 'a) (property : Property<'b>) : Property<'a> =
property |> map (fun _ -> a)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I never caught this until looking at this diff, but should we be using always here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you elaborate? What is always?


let private bindGen
Expand Down Expand Up @@ -323,7 +323,7 @@ module PropertyBuilder =
member __.Counterexample(m : Property<'a>, [<ProjectionParameter>] f : 'a -> string) : Property<'a> =
m |> Property.bind (fun x ->
Property.counterexample (fun () -> f x)
|> Property.map (fun () -> x))
|> Property.set x)

[<CustomOperation("where", MaintainsVariableSpace = true)>]
member __.Where(m : Property<'a>, [<ProjectionParameter>] p : 'a -> bool) : Property<'a> =
Expand Down