5 ms·
No you don't, you merely need each index into an array to be a monad over all possible values it can contain. An array is itself and modifications are (take as
by smitherfield 10y ago
No you don't, you merely need each index into an array to be a monad over all possible values it can contain. An array is itself and modifications are (take as arguments and return) its indices.
- DonaldFisk 10y agoAnd how is that implemented under the hood?
- smitherfield 10y agoSame as in a higher-level statically typed imperative language: mutable arrays contained within larger dynamic buffers for amoritized constant-time append and prepend.
- DonaldFisk 10y agoSo it isn't really functional at all. It just hides the side effects behind a lot of complexity.
- junke 10y agoThis is precisely what functional programming does. Purely functional abstractions are just that, abstractions.
- kazinator 10y ago> you merely need each index into an array to be a monad over all possible values it can contain Now keep a straight face and say "L1 cache" once again.