|
|
|
# Proposal: remove `n+k` patterns from the language
|
|
|
|
|
|
|
|
|
|
|
|
## Pros
|
|
|
|
|
|
|
|
|
|
|
|
- `n+k` patterns are a non-orthogonal feature:
|
|
|
|
|
|
|
|
- no other datatype has this special notation
|
| ... | ... | @@ -13,7 +15,8 @@ |
|
|
|
|
|
|
|
## Cons
|
|
|
|
|
|
|
|
|
|
|
|
- it is a concise, natural, and familiar notation for recursion over naturals
|
|
|
|
- it allows recursive functions over naturals to be defined using non-overlapping patterns
|
|
|
|
- it would make a lot more sense if we had [a natural number type](natural), and restricted `n+k` patterns appropriately
|
|
|
|
- it would make a lot more sense if we had a natural number type, and restricted `n+k` patterns appropriately
|
|
|
|
- some Haskell books use it (this was the main reason it was kept in Haskell 98) |