constants and functions without arguments
Fri, 30 Mar 2001 07:18:44 -0500
Andreas Leitner wrote:
> I hope this is the right forum to post my question to.
> Given a lazy pure functional language do we need to differntiate (in
> syntax) between constants and functions without agruments? And if we
> don't need to, does Haskell make a difference?
From a pedantic point of view your question makes no sense. The definition
of a function is something that takes an argument and transforms it to a
result. So a function always has exactly one argument. Period.
But from a practical point of view, yes you can regard constants as functions
with no arguments. And it makes sense from a syntactic point of view:
f0 = e0
f1 x = e1
f2 x y = e2
f3 x y z = e3