|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Allow Undecidable Instances
|
|
|
|
|
|
|
|
|
|
|
|
## Brief Explanation
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
There are no restrictions on the form of instance declarations (see [FlexibleInstances](flexible-instances)).
|
|
|
|
Implementations ensure termination by making context reduction fail if it exceeds some depth limit.
|
|
|
|
|
|
|
|
|
|
|
|
## References
|
|
|
|
|
|
|
|
|
|
|
|
- [ Undecidable instances](http://www.haskell.org/ghc/docs/latest/html/users_guide/type-extensions.html#undecidable-instances) in the GHC User's guide.
|
|
|
|
|
|
|
|
## Tickets
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<table><tr><th>[\#71](https://gitlab.haskell.org//haskell/prime/issues/71)</th>
|
|
|
|
<td>Allow Undecidable Instances</td></tr></table>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## Pros
|
|
|
|
|
|
|
|
|
|
|
|
- allows safe instances that would be rejected by conservative termination checks (see [FlexibleInstances](flexible-instances)).
|
|
|
|
- offered by GHC and Hugs with appropriate options for several years.
|
|
|
|
- experience has shown that increasing the depth limit rarely makes a difference in which programs are accepted.
|
|
|
|
|
|
|
|
## Cons
|
|
|
|
|
|
|
|
|
|
|
|
- the boundary between legal and illegal programs is unclear, and possibly implementation-dependent. |