... | ... | @@ -10,3 +10,20 @@ to fix it we can |
|
|
- get rid of all other special treatment of '-'
|
|
|
- people can use 'negate' if they want to negate non literals.
|
|
|
- the removal of n + k patterns will make this more attractive
|
|
|
|
|
|
|
|
|
Cons
|
|
|
|
|
|
- This does introduce a syntactic oddity, namely that `-1` is different from `- 1`.
|
|
|
|
|
|
- In Haskell 98, '-' is explicitly excluded from right sections, so:
|
|
|
|
|
|
```wiki
|
|
|
Prelude> :t (- 1)
|
|
|
(- 1) :: (Num a) => a
|
|
|
Prelude> :t (1 -)
|
|
|
(1 -) :: (Num a) => a -> a
|
|
|
```
|
|
|
|
|
|
> >
|
|
|
> > 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. |