title: Reduce duplication in Haskell Servant
body: <p>The project I'm working on involve calling to CloudFlare API. I've already define the API using Servant (client) and I'm able to make a client out of it. However, CloudFlare API requires authentication headers, so all of my API types end up with duplication. Is there any way to get rid of those at the type level? I'm happy with the client derived functions require those parameters.</p>
  
  <p>Example code:</p>
  
  <pre><code>type ListZones = "zones"
    :&gt; Header "X-Auth-Email" Text
    :&gt; Header "X-Auth-Key" Text
    :&gt; Get '[JSON] (Result [Zone])
  
  type ListRecords = "zones"
    :&gt; Header "X-Auth-Email" Text
    :&gt; Header "X-Auth-Key" Text
    :&gt; Capture "zone_uuid" Text
    :&gt; "dns_records"
    :&gt; Get '[JSON] (Result [Record])
  
  type CreateRecord = "zones"
    :&gt; Header "X-Auth-Email" Text
    :&gt; Header "X-Auth-Key" Text
    :&gt; Capture "zone_uuid" Text
    :&gt; "dns_records"
    :&gt; ReqBody '[JSON] Record
    :&gt; Post '[JSON] (Result Record)
  
  type UpdateRecord = "zones"
    :&gt; Header "X-Auth-Email" Text
    :&gt; Header "X-Auth-Key" Text
    :&gt; Capture "zone_uuid" Text
    :&gt; "dns_records"
    :&gt; Capture "record_uuid" Text
    :&gt; ReqBody '[JSON] Record
    :&gt; Patch '[JSON] (Result Record)
  </code></pre>