Created
March 8, 2020 23:22
-
-
Save TheFo2sh/2d43c49a67c56fe87011497b1f2c24bd to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public partial FunctionaObject2 where T: class, ICloneable, new() | |
{ | |
public static Func<FunctionalObject<T>, P> NewGetLens<P>(Func<T, P> func) | |
{ | |
return (o => func.Invoke(o.GetValue())); | |
} | |
public static Func<FunctionalObject<T>, FunctionalObject<T>> NewSetLens(Action<T> func) | |
{ | |
return o => o.With(func); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment