
4 Feb
2011
4 Feb
'11
3:43 a.m.
Am 03.02.2011 22:42, schrieb Aristid Breitkreuz:
Hi,
I just wanted to announce that I uploaded a first version of http-types to hackage:
With your two types Method and MethodADT I would omit "OtherMethod" in MethodADT, since a mere enumeration type is much better: data StdMethod = GET | POST | HEAD | PUT | DELETE | TRACE | CONNECT | OPTIONS deriving (Show, Eq, Ord, Enum, Bounded) method :: StdMethod -> Method method = Ascii.pack . show methodListB :: [(Method, StdMethod)] methodListB = map (\ s -> (method s, s)) [minBound .. maxBound] methodToStdMethod :: Method -> Maybe StdMethod methodToStdMethod = flip lookup methodListB Cheers Christian