
22 Mar
2004
22 Mar
'04
10:29 a.m.
newtype Method = Method String getMethod = Method "GET" putMethod = Method "PUT"
[...]
doMeth getMethod = ... doMeth putMethod = ...
For Haskell the last two lines look both like pattern-matching on a variable which always matches. You might as well have written: doMeth x = ... doMeth y = ... There is no macro facility in Haskell so you cannot give patterns a name like you do in line 2 and 3. You will have to write: doMeth (Method "GET") = ... doMeth (Method "PUT") = ... Good luck, Arjan