|
|
>>> ([] , _ ) -> Nothing
>>
>> Yeh, it's really clear what this line does to a non-Haskeller :-)
>
> It's pretty standard notation for functional languages. Erlang uses the
> same notation. If you get a two-element tuple with the first element being
> an empty list, the result is an arbitrary atomic value (not unlike an
> "enum") called "Nothing".
Sure, I didn't doubt there was a pretty easy explanation behind it, it's
just [], _ and the whole statement syntax had no meaning to me before it was
explained. I would imagine once Andrew knew what -- and * does in C (I
think < and ! are common enough not to need to explain?) he would know what
the statement he highlighted meant too. I don't see much difference.
Post a reply to this message
|
|