2 ms·
It's one of those things that you arrive at yourself. You rarely, if ever, understand them from Haskell-ish mathematical-ish constructs like these. Sometimes y
by dmitriid 9y ago
It's one of those things that you arrive at yourself. You rarely, if ever, understand them from Haskell-ish mathematical-ish constructs like these.
Sometimes you could end up with this code in situations like this:
const data = getDataForUser(user);
const transformer = getTransformersForGDPR();
const sanitizedData = transformer(data);
where getTransformersForGDPR returns a single function that may contain a chain of data transformations.
The example is contrived, of course, but you do end up with similar constructs especially if you have been exposed to functional programming.
- joeframbach 9y agoAh, that does make sense. I think this happens in the React world sometimes, where a single state holds the source of truth for everything, and we end up passing parts of it around to other methods to make decisions. const data = getDataFromState(state); const transformer = getTransformersForState(state); const sanitizedData = transformer(data);