Fwd: Here's why functions should return functions

Oops, I forgot to "reply-all"
---------- Forwarded message ----------
From: Antoine Latter
There is, in most sub-systems of mathematics, whether like recent type theory or not, a general function, let us call it mcf which in Scheme notation may be defined by executing
(define mcf (lambda (a) (lambda (x) a)))
Now in Haskell I know that one, perhaps the, parallel definition must result in a polymorphic function.
What is this definition? How polymorphic is it? What implicit constraints are on a? Does "lazy vs eager" come in here? Are there options to ghc which might modify how Haskell handles the definition?
I think this is it: http://hackage.haskell.org/packages/archive/base/latest/doc/html/Prelude.htm... It's definitions is: const x _ = x Antoine
Of course, my questions are too many and I hope just for some indications of the first things a beginner should study.
oo--JS.
PS. Below is a short Scheme session showing some of the behavior of Scheme.
SCM version 5d9, Copyright (C) 1990-2002 Free Software Foundation. SCM comes with ABSOLUTELY NO WARRANTY; for details type `(terms)'. This is free software, and you are welcome to redistribute it under certain conditions; type `(terms)' for details. ;loading /usr/local/lib/slib/require ;done loading /usr/local/lib/slib/require.scm
(define mcf
(lambda (a) (lambda (x) a))) #<unspecified>
(define const-17 (mcf 17))
#<unspecified>
(const-17 "abc")
17
(define const-1+ (mcf 1+))
#<unspecified>
(const-1+ "abc")
#
((const-1+ "abc") 200)
201
((const-1+ 56) 200)
201
(quit)
;EXIT
Process scheme finished
_______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners
participants (1)
-
Antoine Latter