[Haskell-cafe] map (-2) [1..5]

Brian Hulley brianh at metamilk.com
Thu Aug 17 19:20:54 EDT 2006


David House wrote:
> On 17/08/06, Brian Hulley <brianh at metamilk.com> wrote:
>> Literal highlighting in the editor would make it clear that x-2 ===
>> x (-2). I think a basic issue is that at the moment it is strange
>> that non-negative numbers can be specified as literals but negative
>> numbers can't - they can only get in through the "back door" of
>> evaluation - which just doesn't seem right.
>
> You also can't specify string literals: they're sugar for
> 'a':'b':'c':[]. You seem to be arguing that syntactic sugar, and by
> extension, a small core language, is bad.

All I'm saying is that given a type, either all the inhabitants should have 
a literal form or none of them should, because otherwise the availability of 
literals skews one's relationship to the inhabitants.

Ie the lack of negative literals tells me that I should think of negative 
integers as being "derived" from positive integers via negation, whereas the 
declaration

    data Integer = ... | -1 | 0 | 1 | ...

tells me that the negative and positive integers are on an equal footing.

Ie the language is sending out a "mixed message" about the integers, which 
is confusing.

Regards, Brian.
-- 
Logic empowers us and Love gives us purpose.
Yet still phantoms restless for eras long past,
congealed in the present in unthought forms,
strive mightily unseen to destroy us.

http://www.metamilk.com 



More information about the Haskell-Cafe mailing list