shapeless icon indicating copy to clipboard operation
shapeless copied to clipboard

Add variants of Fn{To,From}Product which are parametric in the result type

Open milessabin opened this issue 9 years ago • 3 comments

See this gist for a motivating example.

A result type parametric Fn{To,From}Product would allow us to constrain the shape of the arguments to an arbitrary arity function type without having to commit a particular result type. In the example shown we've worked around this by constraining an HList argument L to a Function1 and then have an implicit conversion from an arbitrary arity function to that L => R. This only works if the type of the function is fully known, hence the type annotations on the function's arguments.

milessabin avatar Jul 30 '15 10:07 milessabin

@milessabin do you mean something like FnGeneric in this PR: typelevel/kittens#223 Do you think it makes sense to contribute it to shapeless instead?

joroKr21 avatar Mar 16 '20 17:03 joroKr21

Honestly I have no recollection of what this issue is about and the description and the gist are leaving me none the wiser.

I don't have any strong feelings about whether that PR belongs in kittens or here.

milessabin avatar Mar 21 '20 18:03 milessabin

I don't have any strong feelings about whether that PR belongs in kittens or here.

Me neither. Then I would keep it in kittens.

joroKr21 avatar Mar 22 '20 09:03 joroKr21

If anyone needs this they can use the version from Kittens: https://github.com/typelevel/kittens/pull/223

joroKr21 avatar Sep 12 '22 18:09 joroKr21