Re:Smashing Swift
by platz on Sunday June 15, 2014 @06:44PM
(#7896592)
Some folks are working on a library for this already: https://github.com/maxpow4h/swiftz
[ Parent
| on HN ]
yup. we have a "Functor" 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.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.