| ... | @@ -29,6 +29,16 @@ But what is the value of **fib (-3)**? A runtime stack overflow! Much better t |
... | @@ -29,6 +29,16 @@ But what is the value of **fib (-3)**? A runtime stack overflow! Much better t |
|
|
If we do add them, then (a) they should probably be arbitrary in size; and (b) function definitions like fib should \*not\* be overloaded on Num, but should be monomorphic in Nat.
|
|
If we do add them, then (a) they should probably be arbitrary in size; and (b) function definitions like fib should \*not\* be overloaded on Num, but should be monomorphic in Nat.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## Comment
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Not unreasonable at all, but restricting numeric patterns to Nat (actually, I'd say Natural if they're arbitrary in size) would likely break
|
|
|
|
quite a bit of code, and I wonder if the payback in practice actually is worth it for Haskell'. Also, "-" and possibly other operations
|
|
|
|
would presumably become partial, which might introduce new bugs. (Yes, could also return 0, but that could be a bit surprising as well.)
|
|
|
|
Also, I don't think this has been widely implemented and tested yet, and thus it's hard to gauge the impact?
|
|
|
|
|
|
|
|
|
|
|
## Proposal
|
|
## Proposal
|
|
|
|
|
|
|
|
|
|
|
| ... | | ... | |