3 ms·
I really do not see how black box abstraction is the problem (in the functional sense). Really I see this more as a problem of composability of software. This
by nightski 16y ago
I really do not see how black box abstraction is the problem (in the functional sense). Really I see this more as a problem of composability of software. This is what attracted me to say Haskell in the first place over mainstream object oriented languages. Sure a module might expose a top level function that makes a lot of assumptions about implementation behavior. But if you don't like how that behavior is composed, you can always create a new function that would compose the behavior in a different way.
All this meta-interface stuff seems like it is way more complicated than it needs to be... Please show me what I am missing.
- swannodette 16y agoFunctions are not enough since functions are implementations. Haskell type classes on the other hand represent the kind of thinking being discussed here.
- nightski 16y agoTotally agreed. I did not mean to imply all you need is functions. Just that Haskell allows for much more flexible and correct composition of software (especially when dealing with side effects) solving many of the issues in the OP without reflection and meta interface complexity. Not to say Haskell is perfect, just that I see this as a composition problem, not a failure of black box abstraction.
- artsrc 16y agoThis is how I think about it. Imagine you have a block box that calculates a interest rate futures convexity adjustment. That is for an OTC forward you have one fair value and for a future you have a different fair value because the future is has margins and the function calculates the difference between the two. Now you have some useful code that works out margin payments for various trajectories of prices for the future/forward based on some model for price movements and and another model for interest payments/reciepts on the margin calls. Now you have a simple change where some exchange changes way they do margin calls. One way to resolve this is that convexity adjustment function takes in a margining function as a parameter. But if it was not known that this was needed from the start maybe another part of the model was parameterized rather than this. In practice in this case assumptions about the margining are baked into the mathematics of the black box, and handling arbitrary margining systems is not done and you write a whole new function.
- nightski 16y agoI still see that as a composition problem and not one of abstraction.