NULLs

Sami Mäkelä mrsmkl@saunalahti.fi
Mon, 19 Jul 1999 19:29:09 +0300


Hans-Dieter.Dreier@materna.de wrote:

> sami@pefletti.saunalahti.fi wrote:
>
> >Hans-Dieter.Dreier@materna.de wrote:
> >
> >>But why do you write "Just a" in the last line instead of "Just Int"?
> >>And why the parentheses around "(Just a)"?
> >
> >in "Just a", 'a' is variable that is bound if the function argument matches
> >this case.
>
> Is it also allowed to write "Just Int"? Would there be any difference (other than being independent of the name "a" in the definition of "Maybe a") ?
>

it could be any variable name ... for example 'int'. it can't be 'Int' because compiler assumes thatcapitalized identifiers are for constructors

> > parentheses are needed so that the compiler knows that "Just a" is
> >a single
> >pattern
>
> What would happen it they were omitted?
>

compiler would output an error  like:
Equations give different arities for "maybe_square"