[Haskell-cafe] Re: What's the deal with Clean?
Richard O'Keefe
ok at cs.otago.ac.nz
Sun Nov 8 20:03:16 EST 2009
>>>>
>>>> One of this differences between Haskell and Clean I did not see
>>>> mentioned in
>>>> this discussion is that Clean does not allow so-called partial
>>>> parametrisation. I.e. all function calls have to be fully saturated
I think there may be a misunderstanding here.
Beware: I haven't used Clean in a while.
(1) Clean didn't have sections.
This is no big deal. Clean does have "flip" in StdFunc.
(x +) => (+) x
(+ y) => (flip (+)) y
(2) Clean requires saturated *DEFINITIONS*.
If you declare
f :: A B C -> D
then each rule you give for f must have exactly three arguments.
If you declare
f :: A -> B -> C -> D
then each rule you give for f must have exactly one argument.
See section 3.7 of the Clean 2.1 language report.
This has no consequences for how you can *apply* such a
function. Section 3.7.1 of the report is explicit:
In CLEAN all symbols (functions and constructors) are
defined with fixed arity. However, in an application
it is of course allowed to apply them to an arbitrary
number of arguments. A curried application of a
function is an application of a function with a number
of arguments which is less than its arity (note that
in CLEAN the arity of a function can be derived from
its type). With the aid of the predefined internal
function _AP a curried function applied on the
required number of arguments is transformed into an
equivalent uncurried function application. The type
axiom's (sic.) of the CLEAN type system include for
all s defined with arity n the equivalence of
s::(t1->(t2->(...(tn->tr)...)) with
s::t1 t2 ... tn -> tr.
More information about the Haskell-Cafe
mailing list