
16 Dec
2008
16 Dec
'08
7:26 a.m.
"Kwanghoon Choi"
===================================================================== instance Arg a => Arg [a] where pr _ = "[" ++ pr (undefined :: a) ++ "]" =====================================================================
You want to use `asTypeOf`, with a lazy pattern to name a value of type 'a'. pr xs = "[" ++ pr (undefined `asTypeOf` x) ++ "]" where (x:_) = xs or pr ~(x:_) = "[" ++ pr (undefined `asTypeOf` x) ++ "]" Regards, Malcolm