I actually ended up using a lookup list e.g. handlers=[(getMethod,doGet),(putMethod,doPut)]
which has the convenience of being able to put a 501 "Not Implemented" in an obvious place. I'll post the code shortly. My goal is to form the core of a generically useful HTTP haskell server library. -Alex- On Mon, 22 Mar 2004, Ketil Malde wrote: > "Arjan van IJzendoorn" <[EMAIL PROTECTED]> writes: > > >> newtype Method = Method String > >> getMethod = Method "GET" > >> putMethod = Method "PUT" > >> doMeth getMethod = ... > >> doMeth putMethod = ... > > > You will have to write: > > > > doMeth (Method "GET") = ... > > doMeth (Method "PUT") = ... > > Or (I assume, haven't tested) if you insist on renaming the methods: > > doMeth m | m == getMethod = ... > | m == putMethod = ... > > (or using a case statement, of course) > > -kzm > -- > If I haven't seen further, it is by standing in the footprints of giants > _________________________________________________________________ S. Alexander Jacobson mailto:[EMAIL PROTECTED] tel:917-770-6565 http://alexjacobson.com _______________________________________________ Haskell-Cafe mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell-cafe
