Can you just write:<br><br>data ListGT map k a<br> = Empt<br> | BraF ![k] a !(map (ListGT map k a))<br> | BraE ![k] !(map (ListGT map k a))<br> deriving( Typeable )<br><br>?<br><br><div><span class="gmail_quote">On 7/7/07,
<b class="gmail_sendername">Adrian Hey</b> <<a href="mailto:ahey@iee.org">ahey@iee.org</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hello,<br><br>I'm trying to make the type (ListGT map k a) an instance of Typeable,<br>where map is kind (* -> *).<br><br>data ListGT map k a<br> = Empt<br> | BraF ![k] a !(map (ListGT map k a))<br> | BraE ![k] !(map (ListGT map k a))
<br><br>I thought I'd cracked it with something like this..<br><br>instance (Typeable (map (ListGT map k a)), Typeable k, Typeable a) =><br> Typeable (ListGT map k a) where<br> typeOf lgt = mkTyConApp (mkTyCon "
Data.Trie.General.ListGT")<br> [mTypeRep, kTypeRep, aTypeRep]<br> where BraF [k] a m = lgt -- This is just to get types for k a m !!<br> kTypeRep = typeOf k<br> aTypeRep = typeOf a
<br> mTypeRep = typeOf m<br><br>However, showing the resulting TypRep gives a stack overflow. I wasn't<br>too surprised about this, so I tried replacing the last line with..<br> mTypeRep = mkTyConApp (typeRepTyCon (typeOf m)) []
<br>..thinking that this would make it terminate. But it doesn't.<br><br>Could someone explain how to do this?<br><br>Thanks<br>--<br>Adrian Hey<br><br><br>_______________________________________________<br>Haskell-Cafe mailing list
<br><a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br><a href="http://www.haskell.org/mailman/listinfo/haskell-cafe">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br></blockquote></div><br>