Skip to content

Conversation

@csillikd-messerli
Copy link
Contributor

I deliberately chose Flatten; I find Join less self-explanatory.

@csillikd-messerli
Copy link
Contributor Author

csillikd-messerli commented May 29, 2025

@bash @FreeApophis Do you have any idea about the error? Lazy also has a public parameterless ctor!

@bash
Copy link
Member

bash commented May 29, 2025

Yeah Lazy is a bit annoying because its generic type is annotated with [DynamicallyAccessedMembers(PublicParameterlessConstructor)] and this leaks out in the sense that you have to annotate all your Ts with that attribute too.

I think defining your own Identity function should do the trick:

[Pure]
[MethodImpl(MethodImplOptions.AggressiveInlining)]
private static T Identity<[DynamicallyAccessedMembers(PublicParameterlessConstructor)] T>(T value) => value;

You can see how I dealt with this issue here: https://github.com/polyadic/funcky/blob/main/Funcky/Monads/Lazy/Lazy.Monad.cs 😄

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