SYB gone wild - mysterious <<loop>> in code derived from an syb-with-class example
(From http://www.haskell.org/pipermail/haskell-cafe/2009-December/070193.html)
In the attached code,
- if you load the code into ghci and evaluate e it will hang, but (defaultValueD dict) :: Expression returns fine
- if you change the gunfold instance for Proposition to, error "gunfold" it stops hanging -- even though this code is never called.
- if you change, ( Data ctx [Expression], Sat (ctx Expression) => Data ctx Expression, to (Data ctx Expression, ....) => ... it stops hanging.
If someone could explain why each of these cases perform as they do, that would be awesome! Right now it is a big mystery to me.. e calls dict .. and there is only one instance of dict available, which should call error right away. I can't see how something could get in the way there...
Trac metadata
Trac field | Value |
---|---|
Version | 6.12.1 RC1 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | Compiler |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | |
Architecture |