Christian, I incorporated your approach of defining the ADT, and Michael&#39;s suggestions into<div><br></div><div>*tada*</div><div><br></div><div>http-types 0.2.0 - <a href="http://hackage.haskell.org/package/http-types-0.2.0">http://hackage.haskell.org/package/http-types-0.2.0</a></div>

<div><br></div><div>Features:</div><div>* StdMethod is an enumeration without OtherMethod constructor, containing only RFC 2616 standard HTTP methods.</div><div>* parseMethod :: ByteString -&gt; Either ByteString StdMethod (I think the type says all).</div>

<div>* There are a few pre-defined Headers (headerAccept...)</div><div>* urlEncode / urlDecode</div><div>* Parsing and rendering of query strings (Query / SimpleQuery).</div><div><br></div><div>I hope this is closer to what most people would consider a nice version.</div>

<div><br></div><div><br></div><div>Aristid</div><div><br><br><div class="gmail_quote">2011/2/4 Christian Maeder <span dir="ltr">&lt;<a href="mailto:Christian.Maeder@dfki.de">Christian.Maeder@dfki.de</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

Am 04.02.2011 11:49, schrieb Christian Maeder:<br>
<div class="im">&gt; The disadvantage for just strings are possible spelling errors. With<br>
&gt; constants or constructors spelling errors are detected by the compiler<br>
&gt; (but you still can confuse constants having the same type).<br>
<br>
</div>Therefore just having<br>
<br>
  type Method = ByteString<br>
<br>
is also less safe, because constants for methods and i.e. header names<br>
(if they are also just byte strings) can be mixed up without type errors.<br>
<br>
Better would be a newtype wrapper around byte strings (or just strings):<br>
<br>
  newtype Method = M ByteString<br>
<br>
But I do not want to interfere with Michael Snoymann&#39;s compatibility<br>
issues for wai.<br>
<br>
Cheers Christian<br>
</blockquote></div><br></div>