Changes between Version 3 and Version 4 of NegativeSyntax


Ignore:
Timestamp:
Dec 5, 2005 12:53:59 PM (10 years ago)
Author:
simonmar@…
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • NegativeSyntax

    v3 v4  
    99 * people can use 'negate' if they want to negate non literals.
    1010 * the removal of n + k patterns will make this more attractive
     11
     12Cons
     13
     14 * This does introduce a syntactic oddity, namely that {{{-1}}} is different from {{{- 1}}}.
     15
     16 * In Haskell 98, '-' is explicitly excluded from right sections, so:
     17
     18{{{
     19Prelude> :t (- 1)
     20(- 1) :: (Num a) => a
     21Prelude> :t (1 -)
     22(1 -) :: (Num a) => a -> a
     23}}}
     24
     25  If we removed special treatment of '-', then these become symmetrical again.  However it seems unintuitive that {{{(-x)}}} is a right section of '-', but {{{(-1)}}} is the literal -1.