3 ms·
Some folks are working on a library for this already: https://github.com/maxpow4h/swiftz https://github.com/maxpow4h/swiftz
by platz 12y ago
Some folks are working on a library for this already: https://github.com/maxpow4h/swiftz https://github.com/maxpow4h/swiftz
- maxpow4h 12y agoyup. we have a "Functor" https://github.com/maxpow4h/swiftz/blob/master/swiftz/Unsound/Functor.swift https://github.com/maxpow4h/swiftz/blob/master/swiftz/Unsoun... It requires constructing a "Functor" value manually, otherwise it works fine. You can still write functions over an A in Functor. The Result enum bug presented you can work around by boxing the type, such as in https://github.com/maxpow4h/swiftz/blob/master/swiftz/List.swift https://github.com/maxpow4h/swiftz/blob/master/swiftz/List.s... The third problem a work around exists for: remove the default argument. If you want an empty init, provide one. Sure it is buggy, but you can express these programs.
- afthonos 12y agoThanks for the Box suggestion; I'll try it and see how it works for me. I wouldn't have thought of that workaround.