What exactly is meant by “partial function” in functional programming?What is a monad?What are metaclasses in Python?What is the difference between @staticmethod and @classmethod?What does the “yield” keyword do?What is the difference between Python's list methods append and extend?What does if __name__ == “__main__”: do?Using global variables in a functionHow to make a chain of function decorators?What is (functional) reactive programming?“Least Astonishment” and the Mutable Default Argument
Can Microsoft employees see my data in Azure?
What exactly is meant by "partial function" in functional programming?
Use GPLv3 library in a closed system (no software distribution)
Are Star Trek races uniform?
Who discovered the covering homomorphism between SU(2) and SO(3)?
What is gerrymandering called if it's not the result of redrawing districts?
How to cut a perfect shape out of 4cm oak?
Have the US and Russia (or USSR before it) co-vetoed a UN resolution before today?
What is the white square near the viewfinder of the Fujica GW690?
When is "了" pronounced "le" and when is it pronounced "liao"?
Why are Krueger flaps called flaps and not slats?
Moving through the space of an invisible enemy creature in combat
Reading GeoPackage with large features is very slow
I run daily 5kms but I cant seem to improve stamina when playing soccer
Linux Commands in Python
Does any politician - honestly - want a No Deal Brexit?
When was the famous "sudo warning" introduced? Under what background? By whom?
Oko, Thief of Crown's +1 vs. Deputy of Detention
Does code obfuscation give any measurable security benefit?
Sitecore Powershell skip items in System Folder
Nobel prize in literature 2018 - what is "encyclopedic passion"?
Interrupt child processes from bash script on Ctrl+C
Why is 10.1.255.255 an invalid broadcast address?
Meaning of “Bulldog drooled courses through his jowls”
What exactly is meant by “partial function” in functional programming?
What is a monad?What are metaclasses in Python?What is the difference between @staticmethod and @classmethod?What does the “yield” keyword do?What is the difference between Python's list methods append and extend?What does if __name__ == “__main__”: do?Using global variables in a functionHow to make a chain of function decorators?What is (functional) reactive programming?“Least Astonishment” and the Mutable Default Argument
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty
margin-bottom:0;
According to my understanding, partial functions are functions that we get by passing fewer parameters to a function than expected. For example, in Python:
def add(x,y):
return x+y
>> new_function = add(1)
>> new_function(2)
>> 3
In the snippet above, new_function is a partial function. However, according to the Haskell Wiki, the definition of partial function is
A partial function is a function that is not defined for all possible arguments of the specified type.
so, my question is: what exactly is meant by "partial function"?
python haskell functional-programming partial-application partial-functions
add a comment
|
According to my understanding, partial functions are functions that we get by passing fewer parameters to a function than expected. For example, in Python:
def add(x,y):
return x+y
>> new_function = add(1)
>> new_function(2)
>> 3
In the snippet above, new_function is a partial function. However, according to the Haskell Wiki, the definition of partial function is
A partial function is a function that is not defined for all possible arguments of the specified type.
so, my question is: what exactly is meant by "partial function"?
python haskell functional-programming partial-application partial-functions
13
You are confusing a partially applied function with a partial function.
– Willem Van Onsem
11 hours ago
7
Python'spartialperforms partial application, whereas Haskell does that automatically. The wiki entry refers to partial functions, which is a term from mathematics.
– L3viathan
11 hours ago
yes. Thanks for info @WillemVanOnsem
– Saurabh kukade
11 hours ago
yes. Thanks for info @L3viathan
– Saurabh kukade
11 hours ago
2
Strictly speaking, Haskell doesn't do partial function application. Every function takes one argument, and function application applies a function to a single argument. Currying simulates what you would think of as partial application in another language by simulating multiple-argument functions in the first place. Something likeadd 3 5isn't a single function application. This first appliesaddto 3 to get a new function, which is then applied to 5.
– chepner
10 hours ago
add a comment
|
According to my understanding, partial functions are functions that we get by passing fewer parameters to a function than expected. For example, in Python:
def add(x,y):
return x+y
>> new_function = add(1)
>> new_function(2)
>> 3
In the snippet above, new_function is a partial function. However, according to the Haskell Wiki, the definition of partial function is
A partial function is a function that is not defined for all possible arguments of the specified type.
so, my question is: what exactly is meant by "partial function"?
python haskell functional-programming partial-application partial-functions
According to my understanding, partial functions are functions that we get by passing fewer parameters to a function than expected. For example, in Python:
def add(x,y):
return x+y
>> new_function = add(1)
>> new_function(2)
>> 3
In the snippet above, new_function is a partial function. However, according to the Haskell Wiki, the definition of partial function is
A partial function is a function that is not defined for all possible arguments of the specified type.
so, my question is: what exactly is meant by "partial function"?
python haskell functional-programming partial-application partial-functions
python haskell functional-programming partial-application partial-functions
edited 13 mins ago
Rodrigo de Azevedo
8186 silver badges17 bronze badges
8186 silver badges17 bronze badges
asked 11 hours ago
Saurabh kukadeSaurabh kukade
2131 silver badge11 bronze badges
2131 silver badge11 bronze badges
13
You are confusing a partially applied function with a partial function.
– Willem Van Onsem
11 hours ago
7
Python'spartialperforms partial application, whereas Haskell does that automatically. The wiki entry refers to partial functions, which is a term from mathematics.
– L3viathan
11 hours ago
yes. Thanks for info @WillemVanOnsem
– Saurabh kukade
11 hours ago
yes. Thanks for info @L3viathan
– Saurabh kukade
11 hours ago
2
Strictly speaking, Haskell doesn't do partial function application. Every function takes one argument, and function application applies a function to a single argument. Currying simulates what you would think of as partial application in another language by simulating multiple-argument functions in the first place. Something likeadd 3 5isn't a single function application. This first appliesaddto 3 to get a new function, which is then applied to 5.
– chepner
10 hours ago
add a comment
|
13
You are confusing a partially applied function with a partial function.
– Willem Van Onsem
11 hours ago
7
Python'spartialperforms partial application, whereas Haskell does that automatically. The wiki entry refers to partial functions, which is a term from mathematics.
– L3viathan
11 hours ago
yes. Thanks for info @WillemVanOnsem
– Saurabh kukade
11 hours ago
yes. Thanks for info @L3viathan
– Saurabh kukade
11 hours ago
2
Strictly speaking, Haskell doesn't do partial function application. Every function takes one argument, and function application applies a function to a single argument. Currying simulates what you would think of as partial application in another language by simulating multiple-argument functions in the first place. Something likeadd 3 5isn't a single function application. This first appliesaddto 3 to get a new function, which is then applied to 5.
– chepner
10 hours ago
13
13
You are confusing a partially applied function with a partial function.
– Willem Van Onsem
11 hours ago
You are confusing a partially applied function with a partial function.
– Willem Van Onsem
11 hours ago
7
7
Python's
partial performs partial application, whereas Haskell does that automatically. The wiki entry refers to partial functions, which is a term from mathematics.– L3viathan
11 hours ago
Python's
partial performs partial application, whereas Haskell does that automatically. The wiki entry refers to partial functions, which is a term from mathematics.– L3viathan
11 hours ago
yes. Thanks for info @WillemVanOnsem
– Saurabh kukade
11 hours ago
yes. Thanks for info @WillemVanOnsem
– Saurabh kukade
11 hours ago
yes. Thanks for info @L3viathan
– Saurabh kukade
11 hours ago
yes. Thanks for info @L3viathan
– Saurabh kukade
11 hours ago
2
2
Strictly speaking, Haskell doesn't do partial function application. Every function takes one argument, and function application applies a function to a single argument. Currying simulates what you would think of as partial application in another language by simulating multiple-argument functions in the first place. Something like
add 3 5 isn't a single function application. This first applies add to 3 to get a new function, which is then applied to 5.– chepner
10 hours ago
Strictly speaking, Haskell doesn't do partial function application. Every function takes one argument, and function application applies a function to a single argument. Currying simulates what you would think of as partial application in another language by simulating multiple-argument functions in the first place. Something like
add 3 5 isn't a single function application. This first applies add to 3 to get a new function, which is then applied to 5.– chepner
10 hours ago
add a comment
|
3 Answers
3
active
oldest
votes
You are here confusing two concepts. A partially applied function [haskell-wiki] with a partial function [haskell-wiki].
A partially applied function is:
Partial application in Haskell involves passing less than the full number of arguments to a function that takes multiple arguments.
whereas a partial function indeed is a non-total function:
A partial function is a function that is not defined for all possible arguments of the specified type.
add a comment
|
A partial function (both in the context of functional programming and mathematics) is exactly what the wiki says: a function not defined for all of its possible arguments. In the context of programming, we usually interpret "not defined" as one of several things, including undefined behaviour, exceptions or non-termination.
An example of a partial function would be integer division, which is not defined if the divisor is 0 (in Haskell it will throw an error).
in above snippet new_function is partial function.
That code would simply cause an error in Python, but if it worked as you intended, it would be a total (meaning not partial) function.
As commentors already pointed out, you're most likely thinking of the fact that it'd be a partially applied function.
add a comment
|
The answers explain all, I will just add one example in each language:
def add(x,y):
return x+y
f = add(1)
print(f(3))
f = add(1)
TypeError: add() missing 1 required positional argument: 'y'
this is neither a partial function nor a curried function, is a function that you didn't gave all its arguments.
a curried function like in Haskell should be:
partialAdd= lambda x: lambda y: x + y
plusOne = partialAdd(1)
print(plusOne(3))
4
and in haskell:
plus :: Int -> Int -> Int
plus x y = x + y
plusOne = plus 1
plusOne 4
5
A partial function in python:
def first(ls):
return ls[0]
print(first([2,4,5]))
print(first([]))
output
2
print(first([]))
File "main.py", line 2, in first
return ls[0]
IndexError: list index out of range
And in Haskell, as your link showed up:
head [1,2,3]
3
head []
*** Exception: Prelude.head: empty list
So what is a total function?
Well, basically the opposite, is a function that will work for any input of that type, an example in python:
def addElem(xs, x):
xs.append(x)
return xs
and this work even for infinite list, if you make a little trick:
def infiniList():
count = 0
ls = []
while True:
yield ls
count += 1
ls.append(count)
ls = infiniList()
for i in range(5):
rs = next(ls)
print(rs, addElem(rs,6))
[1, 2, 3, 4]
[1, 2, 3, 4, 5] [1, 2, 3, 4, 5]
in Haskell
addElem :: a -> [a] -> [a]
addElem x xs = x : xs
addElem 3 (take 10 [1..])
=> [3,1,2,3,4,5,6,7,8,9,10]
That's is for the functions doesn't hangs forever, but the concept is the same, for every list, the function will work.
add a comment
|
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f58339040%2fwhat-exactly-is-meant-by-partial-function-in-functional-programming%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
You are here confusing two concepts. A partially applied function [haskell-wiki] with a partial function [haskell-wiki].
A partially applied function is:
Partial application in Haskell involves passing less than the full number of arguments to a function that takes multiple arguments.
whereas a partial function indeed is a non-total function:
A partial function is a function that is not defined for all possible arguments of the specified type.
add a comment
|
You are here confusing two concepts. A partially applied function [haskell-wiki] with a partial function [haskell-wiki].
A partially applied function is:
Partial application in Haskell involves passing less than the full number of arguments to a function that takes multiple arguments.
whereas a partial function indeed is a non-total function:
A partial function is a function that is not defined for all possible arguments of the specified type.
add a comment
|
You are here confusing two concepts. A partially applied function [haskell-wiki] with a partial function [haskell-wiki].
A partially applied function is:
Partial application in Haskell involves passing less than the full number of arguments to a function that takes multiple arguments.
whereas a partial function indeed is a non-total function:
A partial function is a function that is not defined for all possible arguments of the specified type.
You are here confusing two concepts. A partially applied function [haskell-wiki] with a partial function [haskell-wiki].
A partially applied function is:
Partial application in Haskell involves passing less than the full number of arguments to a function that takes multiple arguments.
whereas a partial function indeed is a non-total function:
A partial function is a function that is not defined for all possible arguments of the specified type.
answered 11 hours ago
Willem Van OnsemWillem Van Onsem
195k19 gold badges183 silver badges277 bronze badges
195k19 gold badges183 silver badges277 bronze badges
add a comment
|
add a comment
|
A partial function (both in the context of functional programming and mathematics) is exactly what the wiki says: a function not defined for all of its possible arguments. In the context of programming, we usually interpret "not defined" as one of several things, including undefined behaviour, exceptions or non-termination.
An example of a partial function would be integer division, which is not defined if the divisor is 0 (in Haskell it will throw an error).
in above snippet new_function is partial function.
That code would simply cause an error in Python, but if it worked as you intended, it would be a total (meaning not partial) function.
As commentors already pointed out, you're most likely thinking of the fact that it'd be a partially applied function.
add a comment
|
A partial function (both in the context of functional programming and mathematics) is exactly what the wiki says: a function not defined for all of its possible arguments. In the context of programming, we usually interpret "not defined" as one of several things, including undefined behaviour, exceptions or non-termination.
An example of a partial function would be integer division, which is not defined if the divisor is 0 (in Haskell it will throw an error).
in above snippet new_function is partial function.
That code would simply cause an error in Python, but if it worked as you intended, it would be a total (meaning not partial) function.
As commentors already pointed out, you're most likely thinking of the fact that it'd be a partially applied function.
add a comment
|
A partial function (both in the context of functional programming and mathematics) is exactly what the wiki says: a function not defined for all of its possible arguments. In the context of programming, we usually interpret "not defined" as one of several things, including undefined behaviour, exceptions or non-termination.
An example of a partial function would be integer division, which is not defined if the divisor is 0 (in Haskell it will throw an error).
in above snippet new_function is partial function.
That code would simply cause an error in Python, but if it worked as you intended, it would be a total (meaning not partial) function.
As commentors already pointed out, you're most likely thinking of the fact that it'd be a partially applied function.
A partial function (both in the context of functional programming and mathematics) is exactly what the wiki says: a function not defined for all of its possible arguments. In the context of programming, we usually interpret "not defined" as one of several things, including undefined behaviour, exceptions or non-termination.
An example of a partial function would be integer division, which is not defined if the divisor is 0 (in Haskell it will throw an error).
in above snippet new_function is partial function.
That code would simply cause an error in Python, but if it worked as you intended, it would be a total (meaning not partial) function.
As commentors already pointed out, you're most likely thinking of the fact that it'd be a partially applied function.
answered 11 hours ago
sepp2ksepp2k
312k42 gold badges613 silver badges631 bronze badges
312k42 gold badges613 silver badges631 bronze badges
add a comment
|
add a comment
|
The answers explain all, I will just add one example in each language:
def add(x,y):
return x+y
f = add(1)
print(f(3))
f = add(1)
TypeError: add() missing 1 required positional argument: 'y'
this is neither a partial function nor a curried function, is a function that you didn't gave all its arguments.
a curried function like in Haskell should be:
partialAdd= lambda x: lambda y: x + y
plusOne = partialAdd(1)
print(plusOne(3))
4
and in haskell:
plus :: Int -> Int -> Int
plus x y = x + y
plusOne = plus 1
plusOne 4
5
A partial function in python:
def first(ls):
return ls[0]
print(first([2,4,5]))
print(first([]))
output
2
print(first([]))
File "main.py", line 2, in first
return ls[0]
IndexError: list index out of range
And in Haskell, as your link showed up:
head [1,2,3]
3
head []
*** Exception: Prelude.head: empty list
So what is a total function?
Well, basically the opposite, is a function that will work for any input of that type, an example in python:
def addElem(xs, x):
xs.append(x)
return xs
and this work even for infinite list, if you make a little trick:
def infiniList():
count = 0
ls = []
while True:
yield ls
count += 1
ls.append(count)
ls = infiniList()
for i in range(5):
rs = next(ls)
print(rs, addElem(rs,6))
[1, 2, 3, 4]
[1, 2, 3, 4, 5] [1, 2, 3, 4, 5]
in Haskell
addElem :: a -> [a] -> [a]
addElem x xs = x : xs
addElem 3 (take 10 [1..])
=> [3,1,2,3,4,5,6,7,8,9,10]
That's is for the functions doesn't hangs forever, but the concept is the same, for every list, the function will work.
add a comment
|
The answers explain all, I will just add one example in each language:
def add(x,y):
return x+y
f = add(1)
print(f(3))
f = add(1)
TypeError: add() missing 1 required positional argument: 'y'
this is neither a partial function nor a curried function, is a function that you didn't gave all its arguments.
a curried function like in Haskell should be:
partialAdd= lambda x: lambda y: x + y
plusOne = partialAdd(1)
print(plusOne(3))
4
and in haskell:
plus :: Int -> Int -> Int
plus x y = x + y
plusOne = plus 1
plusOne 4
5
A partial function in python:
def first(ls):
return ls[0]
print(first([2,4,5]))
print(first([]))
output
2
print(first([]))
File "main.py", line 2, in first
return ls[0]
IndexError: list index out of range
And in Haskell, as your link showed up:
head [1,2,3]
3
head []
*** Exception: Prelude.head: empty list
So what is a total function?
Well, basically the opposite, is a function that will work for any input of that type, an example in python:
def addElem(xs, x):
xs.append(x)
return xs
and this work even for infinite list, if you make a little trick:
def infiniList():
count = 0
ls = []
while True:
yield ls
count += 1
ls.append(count)
ls = infiniList()
for i in range(5):
rs = next(ls)
print(rs, addElem(rs,6))
[1, 2, 3, 4]
[1, 2, 3, 4, 5] [1, 2, 3, 4, 5]
in Haskell
addElem :: a -> [a] -> [a]
addElem x xs = x : xs
addElem 3 (take 10 [1..])
=> [3,1,2,3,4,5,6,7,8,9,10]
That's is for the functions doesn't hangs forever, but the concept is the same, for every list, the function will work.
add a comment
|
The answers explain all, I will just add one example in each language:
def add(x,y):
return x+y
f = add(1)
print(f(3))
f = add(1)
TypeError: add() missing 1 required positional argument: 'y'
this is neither a partial function nor a curried function, is a function that you didn't gave all its arguments.
a curried function like in Haskell should be:
partialAdd= lambda x: lambda y: x + y
plusOne = partialAdd(1)
print(plusOne(3))
4
and in haskell:
plus :: Int -> Int -> Int
plus x y = x + y
plusOne = plus 1
plusOne 4
5
A partial function in python:
def first(ls):
return ls[0]
print(first([2,4,5]))
print(first([]))
output
2
print(first([]))
File "main.py", line 2, in first
return ls[0]
IndexError: list index out of range
And in Haskell, as your link showed up:
head [1,2,3]
3
head []
*** Exception: Prelude.head: empty list
So what is a total function?
Well, basically the opposite, is a function that will work for any input of that type, an example in python:
def addElem(xs, x):
xs.append(x)
return xs
and this work even for infinite list, if you make a little trick:
def infiniList():
count = 0
ls = []
while True:
yield ls
count += 1
ls.append(count)
ls = infiniList()
for i in range(5):
rs = next(ls)
print(rs, addElem(rs,6))
[1, 2, 3, 4]
[1, 2, 3, 4, 5] [1, 2, 3, 4, 5]
in Haskell
addElem :: a -> [a] -> [a]
addElem x xs = x : xs
addElem 3 (take 10 [1..])
=> [3,1,2,3,4,5,6,7,8,9,10]
That's is for the functions doesn't hangs forever, but the concept is the same, for every list, the function will work.
The answers explain all, I will just add one example in each language:
def add(x,y):
return x+y
f = add(1)
print(f(3))
f = add(1)
TypeError: add() missing 1 required positional argument: 'y'
this is neither a partial function nor a curried function, is a function that you didn't gave all its arguments.
a curried function like in Haskell should be:
partialAdd= lambda x: lambda y: x + y
plusOne = partialAdd(1)
print(plusOne(3))
4
and in haskell:
plus :: Int -> Int -> Int
plus x y = x + y
plusOne = plus 1
plusOne 4
5
A partial function in python:
def first(ls):
return ls[0]
print(first([2,4,5]))
print(first([]))
output
2
print(first([]))
File "main.py", line 2, in first
return ls[0]
IndexError: list index out of range
And in Haskell, as your link showed up:
head [1,2,3]
3
head []
*** Exception: Prelude.head: empty list
So what is a total function?
Well, basically the opposite, is a function that will work for any input of that type, an example in python:
def addElem(xs, x):
xs.append(x)
return xs
and this work even for infinite list, if you make a little trick:
def infiniList():
count = 0
ls = []
while True:
yield ls
count += 1
ls.append(count)
ls = infiniList()
for i in range(5):
rs = next(ls)
print(rs, addElem(rs,6))
[1, 2, 3, 4]
[1, 2, 3, 4, 5] [1, 2, 3, 4, 5]
in Haskell
addElem :: a -> [a] -> [a]
addElem x xs = x : xs
addElem 3 (take 10 [1..])
=> [3,1,2,3,4,5,6,7,8,9,10]
That's is for the functions doesn't hangs forever, but the concept is the same, for every list, the function will work.
edited 9 hours ago
answered 9 hours ago
Damián Rafael LatteneroDamián Rafael Lattenero
12.7k2 gold badges21 silver badges50 bronze badges
12.7k2 gold badges21 silver badges50 bronze badges
add a comment
|
add a comment
|
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f58339040%2fwhat-exactly-is-meant-by-partial-function-in-functional-programming%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
13
You are confusing a partially applied function with a partial function.
– Willem Van Onsem
11 hours ago
7
Python's
partialperforms partial application, whereas Haskell does that automatically. The wiki entry refers to partial functions, which is a term from mathematics.– L3viathan
11 hours ago
yes. Thanks for info @WillemVanOnsem
– Saurabh kukade
11 hours ago
yes. Thanks for info @L3viathan
– Saurabh kukade
11 hours ago
2
Strictly speaking, Haskell doesn't do partial function application. Every function takes one argument, and function application applies a function to a single argument. Currying simulates what you would think of as partial application in another language by simulating multiple-argument functions in the first place. Something like
add 3 5isn't a single function application. This first appliesaddto 3 to get a new function, which is then applied to 5.– chepner
10 hours ago