Skip to main content
14 events
when toggle format what by license comment
Mar 18, 2014 at 16:55 comment added Hyperboreus @RobertHarvey But this is exactly the point of programming languages: What is exposed to you and not what is happening under the hood. The latter is the responsability of the compiler or interpreter, not of the application developper. Otherwise back to assembler.
Mar 18, 2014 at 16:20 comment added Robert Harvey @cimmanon: The whole point of my answer is that immutability is a language construct. You're running Haskell on a machine that is mutable through and through; it is only simulating immutability for your personal benefit.
Mar 18, 2014 at 16:16 comment added cimmanon @RobertHarvey You say that you need mutability because you need to loop (otherwise you have to use recursion). Before I started using Haskell two years ago, I thought I needed mutable variables, too. I'm just saying there's other ways to "loop" (map, fold, filter, etc.). Once you take looping off the table, why else would you need mutable variables?
Mar 18, 2014 at 15:38 comment added Robert Harvey @cimmanon: You're saying that like you think mutable variables are a bad thing.
Mar 18, 2014 at 15:35 comment added cimmanon @RobertHarvey Functions like map are just an abstraction for loops. Any other reason to keep mutable variables?
Mar 17, 2014 at 20:11 comment added amon @Hyperboreus There are many ways to achieve polymorphism. Subtyping with dynamic dispatch, static ad-hoc polymorphism (aka. function overloading) and parametric polymorphism (aka generics) are the most common ways to do that, and all ways have their strengths and weaknesses. Modern OOP languages combine all these three ways, whereas Haskell primarily relies on parametric polymorphism and ad-hoc polymorphism.
Mar 17, 2014 at 19:56 comment added Hyperboreus Then maybe the term polymorphism is used differently in both contexts. I was thinking about something like map :: (a -> b) -> [a] -> [b]. haskell.org/haskellwiki/Polymorphism
Mar 17, 2014 at 19:51 comment added Robert Harvey It's hard to see how the kind of polymorphism that we use in OO has much to do with FP.
Mar 17, 2014 at 19:40 history edited Robert Harvey CC BY-SA 3.0
added 382 characters in body
Mar 17, 2014 at 19:40 comment added Hyperboreus Thank you again and good answer. I have to digest it a bit. I also think that polymorphism and (not inheritance, but) derivation also figure quite centrally in functional languages.
Mar 17, 2014 at 19:37 comment added Robert Harvey Already did....
Mar 17, 2014 at 19:37 comment added Hyperboreus Thank you. Could you please elaborate a bit your last paragraph ("obvious" might be a bit subjective).
Mar 17, 2014 at 19:35 history edited Robert Harvey CC BY-SA 3.0
added 382 characters in body
Mar 17, 2014 at 19:29 history answered Robert Harvey CC BY-SA 3.0