Re:Functional Programming Jargon
by jandrese on Tuesday November 07, 2017 @02:56PM
(#15646928)
This doesn't really seem to save you much, since you're going from:
to
I have to admit I'm a little fuzzy on why currying is desirable so there's probably something obvious I'm missing.
[ Parent
| on HN ]
It's `validateIpAddr(String)`: the first argument is fixed. Suppose you have a list of strings, and you want to extract the ones that are IP addresses. Then you can just write
filter (validate ipRegex) listOfStrings
instead of filter validateIpAddr listOfStrings
where validateIpAddr string = validate ipRegex string