
29 Nov
2012
29 Nov
'12
4:52 p.m.
There is a lot of code in my project like so: code: -------- data SomeThing = Something { center :: ... velocity :: ... ... } instance Locatable SomeThing where center = Something.center instance Moving SomeThing where velocity = Something.velocity instance ... -------- Is there any special extension or syntax trick that would allow me to reduce the amount of this repetitious code? Someway to implicitly state that the functions in the data type are equal to the functions in the class instance, rather than having to spell it out? -- frigidcode.com