3 ms·
I disagree. The benefit of having the standard terms is they are the same in every FP library you use. If you spend the time to learn and internalize them withi
by sswezey 12y ago
I disagree. The benefit of having the standard terms is they are the same in every FP library you use. If you spend the time to learn and internalize them within one, it'll be the same in every language or library that implements them. I don't understand how map, filter, collect, reduce are obtuse or arcane.
- api 12y agoThose aren't the worst offenders. I'm referring to curry, cadr, lambda, monad, etc. But map is confusing: it's also a data structure. "Wait, does map() create a new key-value dictionary?" Filter and collect are okay. Reduce is pretty arcane but tolerable, but the actual operation feels intuitively closer to "categorize" or "group." My point about math was cultural. Math seems to revel in having its own peculiar and often even domain specific (even within mathematics!) terms and symbols for things.
- rosta 12y agoreduce (or fold) would be accumulate, certainly not categorize or group.
- Someone 12y ago1. Map isn't "also a data structure", the data structure is a way to implement a mapping function. There is no conceptual difference between code and data (for an example, see http://en.m.wikipedia.org/wiki/Cons#Not_technically_fundamental http://en.m.wikipedia.org/wiki/Cons#Not_technically_fundamen...) 2. cadr is relatively easy, if you know your assembly (http://en.m.wikipedia.org/wiki/Car_and_cdr#Etymology http://en.m.wikipedia.org/wiki/Car_and_cdr#Etymology) :-) And math has locally defined terms because one cannot give every concept a unique short meaningful memorable name. That is no different in computer science, where 'integer' can include negative numbers or not, may or may not wrap around, can be any number of bits or potentially unlimited, may include minus zero, etc.
- luddypants 12y ago>> 2. cadr is relatively easy, if you know your assembly (http://en.m.wikipedia.org/wiki/Car_and_cdr#Etymology http://en.m.wikipedia.org/wiki/Car_and_cdr#Etymology) :-) If you know IBM 704 assembly...
- kasey_junk 12y agoInteresting enough, my academic background was mostly FP based, but my first heavy industry use of the terms was with the LINQ libraries. I have since had lots of experience with the more academic terms and can pretty easily translate back/forth with no problem. Except for filter. I routinely forget if it is "filter in" vs "filter out". It is easy enough to look up, but I never had that problem with LINQ's "where".