[web-devel] ALPHA: http-types 0.1

Christian Maeder Christian.Maeder at dfki.de
Fri Feb 4 12:49:02 CET 2011


Am 04.02.2011 11:49, schrieb Christian Maeder:
> The disadvantage for just strings are possible spelling errors. With
> constants or constructors spelling errors are detected by the compiler
> (but you still can confuse constants having the same type).

Therefore just having

  type Method = ByteString

is also less safe, because constants for methods and i.e. header names
(if they are also just byte strings) can be mixed up without type errors.

Better would be a newtype wrapper around byte strings (or just strings):

  newtype Method = M ByteString

But I do not want to interfere with Michael Snoymann's compatibility
issues for wai.

Cheers Christian



More information about the web-devel mailing list