-
as seen on Stack Overflow
- Search for 'Stack Overflow'
What is the advantage of Currying in C#?
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
I have a function that looks as follows:
let isInSet setElems normalize p =
normalize p |> (Set.ofList setElems).Contains
This function can be used to quickly check whether an element is semantically part of some set; for example, to check if a file path belongs to an html file:
let…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
Background
I recently read that .NET 4's System.String class has a new overload of the Join method. This new overload takes a separator, and an IEnumerable<T> which allows arbitrary collections to be joined into a single string without the need to convert to an intermediate string array.
Cool…
>>> More
-
as seen on Programmers
- Search for 'Programmers'
I just learned about currying, and while I think I understand the concept, I'm not seeing any big advantage in using it.
As a trivial example I use a function that adds two values (written in ML). The version without currying would be
fun add(x, y) = x + y
and would be called as
add(3, 5)
while…
>>> More
-
as seen on Programmers
- Search for 'Programmers'
I've been reading articles on Functional programming everyday and been trying to apply some practices as much as possible. But I don't understand what is unique in currying or partial application.
Take this Groovy code as an example:
def mul = { a, b -> a * b }
def tripler1 = mul.curry(3)
def…
>>> More