Deriving Data does not work for attached code
For attached code I get this error:
Test2.hs:19:48:
Could not deduce (Real r, Random r)
from the context (Data r, Typeable1 t)
arising from a use of `f'
Possible fix:
add (Real r, Random r) to the context of
the type signature for `dataCast1'
or the instance declaration
In the first argument of `gcast1', namely `f'
In the expression: gcast1 f
In an equation for `dataCast1': dataCast1 f = gcast1 f
Trac metadata
| Trac field | Value |
|---|---|
| Version | 7.1 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler (Type checker) |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | mmitar@gmail.com |
| Operating system | |
| Architecture |