Tag Info

New answers tagged

0

Some considerations regarding the second part of the question: Is it just a poor design choice (if it is a good one, please explain)? For example in scala, you can chain collection methods like smth.map(func1).reduce(func2). It seems much more convenient to me. I do not think that it is poor design: Python supports both procedural and ...


0

Which class would you put these methods on? In python, I can use map on lists, tuples, dictionaries, files, strings, sets, arrays, etc. There is no collection base class to put a map,reduce,filter etc on. Now, python could have had a collection class that all these different things inherited from. But that would really go against the "spirit" of python. In ...


0

I think this is just a historical artifact. These functions were introduced quite a while ago, when fluid interfaces were not all the rage. Since then everyone got used to them. (So yes, you can write it of as "bad design"). Could these functions could be retrofitted to lists? Possibly, but it was not and should not have been done. First, There should be ...


1

I originally came from a C/C++/Ruby background and I used FP concepts in Ruby whenever I could. State just kinda hurt my brain. One of my buddies called me up one day, and he asked me to write something in Haskell (my first - and hopefully not last - Haskell job!). I quickly learned the language and I threw together something that worked. It wasn't beautiful ...


1

NO. And I'm surprised how many people voted otherwise! Paradigm It's Data-Oriented a.k.a. Data-Driven because we are talking about the architecture and not the language it's written in. Architectures are realizations of programming styles or paradigms, which can usually be unadvisably worked around in a given language. Functional? Your comparison to ...


0

My limited understanding is such: 1) Partial Function Application Partial Function Application is the process of returning a function that takes a lesser number of arguments. If you provide 2 out of 3 arguments, it'll return a function that takes 3-2 = 1 argument. If you provide 1 out of 3 arguments, it'll return a function that takes 3-1 = 2 arguments. If ...


4

Well, you already hinted at the answer. Imperative programming is closer to the metal, so it makes more sense in places (like embedded) where you're working closer to the metal. Nobody would bother programming an Arduino in Haskell (well, except maybe for @JimmyHoffa), though programming one in Scheme is not unheard of. Some other reasons: Computing ...


3

You call the types "similar", but they're only similar to you. Compiler knows nothing of this similarity, so you either need the compiler to learn about it, or alleviate it somehow. Here are some possible solutions that I would consider in this situation: Bite the bullet and list all the cases (aka the quick one) Before considering more involved ...



Top 50 recent answers are included