oscbyspro / Ultimathnum

Binary arithmetic reimagined in Swift
Apache License 2.0
9 stars 1 forks source link

Remove implicit error propagation #117

Open oscbyspro opened 3 hours ago

oscbyspro commented 3 hours ago

I'm not convinced that the implicit error propagation approach scales well enough. I say this from a maintenance perspective because performance isn't the issue. I had some ideas of how to abstract over T and Fallible<T> (#54) but this abstraction becomes too arcane (even for wizards) when adding Optional<T> and Optional<Fallible<T>> to the mix. In short, it is an anti-pattern that's neat in isolation.

Maybe it could work as a language feature (cf. optional auto-boxing), but there are other solutions to this problem.

oscbyspro commented 3 hours ago

Also, this makes it trivial to infer the type of integer literals in BinaryInteger/power(...) (#54) (#92).