frunk icon indicating copy to clipboard operation
frunk copied to clipboard

Mapping coproducts

Open ExpHP opened this issue 7 years ago • 1 comments

I discovered there was no map for coproducts when writing the docs for CoprodEmbedder, where I mention what happens if there are duplicate types in the input (which is something that typically only ever really happens as the result of mapping, so I couldn't come up with a palatable code example).

map for coproducts should probably have all of the same features as the one on HLists:

  • Mapping with an hlist![] of FnOnces or a single FnOnce
  • Support for mapping by reference.
  • Anything else I missed

I think I'll get to this at some point after implementing the ergonomics hacks in #90.

ExpHP avatar Mar 21 '18 03:03 ExpHP

Nice 👍

Centril avatar Mar 21 '18 05:03 Centril

Didn't notice this issue when I posted mine, but I implemented this in https://github.com/lloydmeta/frunk/pull/204!

BGR360 avatar Nov 03 '22 16:11 BGR360