Open mwisnicki opened 3 years ago
This would be nice. Did you end up using this in production @mwisnicki?
I would like if there were an easy way to generate a pair of wrap
/unwrap
functions rather than this combined iso
construct. I understand that these two functions witness an isomorphism, but I think it increases the barrier of adoption for newtypes. I think it's reasonable to want to use newtypes without also bringing in optics. Newtypes are far simpler and I consider them some of the "low-hanging fruit" of the modern FP style.
Can you make Iso object extend Function (equivalent to wrap) so it can be used as a constructor of values, such that following computes?
This looks nicer IMHO.
Proof of concept: