non-terminating instances involving FDs
GHC accepts the following (tc109) with -fglasgow-exts:
class P a
class R a b | b->a
instance (P a,R a b) => P [b]
However as pointed out in the FD-CHR paper (example 15), adding the instance
instance R [[a]] [a]
will cause non-termination. Such instances (context contains variables not in the head, even if determined by variables in the head) should be forbidden without -fallow-undecidable-instances. (This is the second part of the Bound Variable Condition in the above paper). Similar cases are tc118 and tc125.
Trac metadata
Trac field | Value |
---|---|
Version | 6.4.1 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | Compiler |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | Unknown |
Architecture | Unknown |