[Haskell-cafe] Newbie Question on type constructors

Antonio Regidor García a_regidor at yahoo.es
Mon Nov 1 22:15:30 EST 2004

Interesting discussion. I'm still learning Haskell and I also thought
about the difference between constructors and functions time ago. I
don't think the question about what a constructor really IS is
meaningful. It can be can be thought as a label, a special function,
... wathever is more useful in each context or to each person. For me,
the main diference between constructors and Haskell functions is that
constructors are never evaluated. A program will never simplify "Circle
5", but does simplify "factorial 5" to "5 * factorial 4" and so on,
until there are only a numeric literal (a constructor, indeed). So
constructors can be tought as some kind of "primitive functions" that
can't be evaluated, or blocks to construct "primitive expressions"
(literals) that can't be further simplified.

Antonio Regidor García

Renovamos el Correo Yahoo!: ¡100 MB GRATIS!
Nuevos servicios, más seguridad

More information about the Haskell-Cafe mailing list