<div dir="ltr">Those are bittorrent types, as defined by the protocol &quot;specifications&quot;<br><br>I was thinking:<br><br>data TPrimitive= TString String | TInt Integer<br>
data TComplex = TList [TPrimitive] | TDict [(String,TPrimitive)]<br>
data T = TPrimitive | TComplex<br><br><br>Would that work?<br><br><br><div class="gmail_quote">On Wed, Jul 30, 2008 at 16:28, Jason Dusek <span dir="ltr">&lt;<a href="mailto:jason.dusek@gmail.com">jason.dusek@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> &nbsp;A data declaration _defines_ type constructors. You describe<br>
 &nbsp;what types those constructors can accept, so this:<br>
<div class="Ih2E3d"><br>
 &nbsp; &nbsp;data T<br>
 &nbsp; &nbsp; &nbsp;= TString String<br>
 &nbsp; &nbsp; &nbsp;| TInt Integer<br>
</div> &nbsp; &nbsp; &nbsp;| TList [T]<br>
 &nbsp; &nbsp; &nbsp;| TDict [(TString, T)]<br>
<br>
 &nbsp;actually doesn&#39;t make any sense -- the list holds what? Holds<br>
 &nbsp;tuples of `TString` and `T`. What type is `TString` ? It&#39;s not<br>
 &nbsp;a type, it&#39;s a constructor! So you need to make it a type.<br>
<br>
 &nbsp;Also, it is not clear to me why the `TDict` can not just map<br>
 &nbsp;`String`s to `T`s -- if you get a `TString` in the course of<br>
 &nbsp;parsing, you can unwrap it.<br>
<font color="#888888"><br>
--<br>
_jsn<br>
</font><div><div></div><div class="Wj3C7c">_______________________________________________<br>
Beginners mailing list<br>
<a href="mailto:Beginners@haskell.org">Beginners@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/beginners" target="_blank">http://www.haskell.org/mailman/listinfo/beginners</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Rafael Gustavo da Cunha Pereira Pinto<br>Electronic Engineer, MSc.<br>
</div>