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

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ambushcat
Copy link

…value in an object.

@JYCabello
Copy link
Owner

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

Copy link
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
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
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;
}
};
Copy link
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