-
as seen on Programmers
- Search for 'Programmers'
This question has been going through my mind quite a lot lately and since I haven't found a convincing answer to it I would like to know if other users
of this site have thought about it as well.
In the recent years, even though OOP is still the most popular programming paradigm, functional programming…
>>> More
-
as seen on Programmers
- Search for 'Programmers'
This question has been going through my mind quite a lot lately and since I haven't found a convincing answer to it I would like to know if other users
of this site have thought about it as well.
In the recent years, even though OOP is still the most popular programming paradigm, functional programming…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
I recently started studying functional programming using Haskell and came upon this article on the official Haskell wiki: How to read Haskell.
The article claims that short variable names such as x, xs, and f are fitting for Haskell code, because of conciseness and abstraction. In essence, it claims…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
When would you NOT want to use functional programming? What is it not so good at?
I am more looking for disadvantages of the paradigm as a whole, not things like "not widely used", or "no good debugger available". Those answers may be correct as of now, but they deal with FP being a new concept (an…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
It seems to me that functional programming is a great thing. It eliminates state and makes it much easier to automatically make code run in parallel.
Many programmers who were first taught imperative programming styles find it very difficult to learn functional programming, because it is so different…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
Hindley-Milner is a type system that is the basis of the type systems of many well known functional programming languages. Damas-Milner is an algorithm that infers (deduces?) types in a Hindley-Milner type system.
Wikipedia gives a description of the algorithm which, as far as I can tell, amounts…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
How does ML perform the type inference in the following function definition:
let add a b = a + b
Is it like C++ templates where no type-checking is performed until the point of template instantiation after which if the type supports the necessary operations, the function works or else a compilation…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
This question was inspired by this answer to another question, indicating that you can remove every occurrence of an element from a list using a function defined as:
removeall = filter . (/=)
Working it out with pencil and paper from the types of filter, (/=) and (.), the function has a type of
removeall…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
foldr:: (a -> b -> b) -> b -> [a] -> b
map :: (a -> b) -> [a] -> [b]
mys :: a -> a
(.) :: (a -> b) -> (c -> a) -> c -> b
what is inferred type of:
a.map mys ::
b.mys map ::
c.foldr map ::
d.foldr map.mys ::
I've tried to create mys myself using mys n…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
When we define our interfaces in C# 4.0, we are allowed to mark each of the generic parameters as in or out. If we try to set a generic parameter as out and that'd lead to a problem, the compiler raises an error, not allowing us to do that.
Question:
If the compiler has ways of inferring what are…
>>> More