With Data.Generics, we can get an object's type, constructor and fields.
I think there should be way to get the object's class(es) and methods.
E. g. I want to find out whether the object's type implements Show,
and if so, call the show method (and if not, call some replacement).
See
Hello Johannes,
Thursday, February 09, 2006, 1:43:38 PM, you wrote:
JW With Data.Generics, we can get an object's type, constructor and fields.
really, SYB way to metaprogramming is just to encode information about
type in the datastructure. you can do somethiong in this fashion just
by
Bulat Ziganshin wrote:
again TH can be used and you will be limited only by the volume of
information, available for TH code.
Is information such as instance C t1 t2 .. available for such code?
I guess not since this would require information from the compiler
(type checker), but TH
waldmann:
With Data.Generics, we can get an object's type, constructor and fields.
I think there should be way to get the object's class(es) and methods.
E. g. I want to find out whether the object's type implements Show,
and if so, call the show method (and if not, call some replacement).
Jim - it's worth looking at the proposal for views, proposed by Warren
Burton et al, accessible from
http://haskell.galois.com/cgi-bin/haskell-prime/trac.cgi/wiki/Views
regards
Simon T
On Thu, 9 Feb 2006, Jim Apple wrote:
Sometimes I'd like to use a smart constructor but have pattern
On Thu, 9 Feb 2006, S.J.Thompson wrote:
Jim - it's worth looking at the proposal for views, proposed by Warren
Burton et al, accessible from
http://haskell.galois.com/cgi-bin/haskell-prime/trac.cgi/wiki/Views
Myself I'm of the view transformational patterns (as described in
Philippa Cowderoy wrote:
Myself I'm of the view transformational patterns (as described in
http://citeseer.ist.psu.edu/299277.html) are more interesting - I can't
help wondering why they were never implemented?
Maybe because of tricky semantics. I'm not quite sure what
case x of
Hello Johannes,
Thursday, February 09, 2006, 2:43:49 PM, you wrote:
again TH can be used and you will be limited only by the volume of
information, available for TH code.
JW Is information such as instance C t1 t2 .. available for such code?
JW I guess not since this would require