Skip to content

Added lens interface with get and set methods. Used to get and set a …#100

Open
ambushcat wants to merge 1 commit intoJYCabello:masterfrom
ambushcat:master
Open

Added lens interface with get and set methods. Used to get and set a …#100
ambushcat wants to merge 1 commit intoJYCabello:masterfrom
ambushcat:master

Conversation

@ambushcat
Copy link
Copy Markdown

…value in an object.

@JYCabello
Copy link
Copy Markdown
Owner

Hey, apologies, I received no email for this. I'll review it after lunch!
Thanks a lot!

Copy link
Copy Markdown
Owner

@JYCabello JYCabello left a comment

Choose a reason for hiding this comment

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

Bump the versions in the csproj file, so a new version gets published.

Thanks a lot.

/// <returns>Value of property of type B.</returns>
[Pure]
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public B Get<A, B>(Lens<A, B> lens, A item) => lens.GetF(item);
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

This function does not need to be generic.

/// <returns>Type A.</returns>
[Pure]
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public A Set<A, B>(Lens<A, B> lens, A item, B value) => lens.SetF(value, item);
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

This function does not be to be generic.

Name = name;
Price = price;
}
}; No newline at end of file
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Please add newlines at the end of both files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants