<div dir="ltr">Those are bittorrent types, as defined by the protocol "specifications"<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"><<a href="mailto:jason.dusek@gmail.com">jason.dusek@gmail.com</a>></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;"> A data declaration _defines_ type constructors. You describe<br>
what types those constructors can accept, so this:<br>
<div class="Ih2E3d"><br>
data T<br>
= TString String<br>
| TInt Integer<br>
</div> | TList [T]<br>
| TDict [(TString, T)]<br>
<br>
actually doesn't make any sense -- the list holds what? Holds<br>
tuples of `TString` and `T`. What type is `TString` ? It's not<br>
a type, it's a constructor! So you need to make it a type.<br>
<br>
Also, it is not clear to me why the `TDict` can not just map<br>
`String`s to `T`s -- if you get a `TString` in the course of<br>
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>