2 ms·
> downside of this approach though, is that using reduce with non-primitive functions can result in domain errors Yes, that's another problem. There is preced
by moonchild 3y ago
> downside of this approach though, is that using reduce with non-primitive functions can result in domain errors
Yes, that's another problem. There is precedent for associating metadata with user-defined functions (eg inverses); identities seem to have fallen by the wayside, but I am planning to fix that for j.
- pfdietz 3y agoDefining a number of related functions seems to be a pattern that comes up elsewhere. For example, consider functions that compute a hash value, canonicalize, and compute some notion of equality. It would be useful to associate all of these.
- moonchild 3y agoHaskell calls these 'typeclasses'; cl calls them 'protocols'. Apl style is not to expose sophisticated user-level abstractions, so I think that there it is not inappropriate that the scope of associable objects (say, a monad, a dyad, an inverse, and an identity; perhaps a few others) be fixed by the language.