Skip to content

Instantly share code, notes, and snippets.

@TheFo2sh
Created March 8, 2020 23:22
Show Gist options
  • Save TheFo2sh/2d43c49a67c56fe87011497b1f2c24bd to your computer and use it in GitHub Desktop.
Save TheFo2sh/2d43c49a67c56fe87011497b1f2c24bd to your computer and use it in GitHub Desktop.
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