servant
servant copied to clipboard
show instance for Headers for debugging
It would be great to have a Show instance for Headers.
I imagine this would generally be used during debugging while writing tests.
The only slightly difficult thing here would be writing the Show instance for HList. It should probably look something like the following:
instance Show (HList '[]) where
show HNil = "HNil"
instance (Show x, Show (HList xs)) => Show (HList (Header h x ': xs)) where
show (HCons responseHeader hlist) = "HCons (" <> show responseHeader <> ") (" <> show hlist <> ")"
(Although in practice, it should be written using showsPrec so that parenthesis are inserted correctly.)
If this would be accepted, I'd be happy to send a PR adding this.
@cdepillabout Hey, sorry for the delay. I'd happily accept such a PR. :)