Code reuse in Haxl - avoiding GADT constructor-per-request-type
问题 Haxl is an amazing library, but one of the major pain points I find is caused by the fact that each sort of request to the data source requires its own constructor in the Request GADT. For example, taking the example from the tutorial: data BlogRequest a where FetchPosts :: BlogRequest [PostId] FetchPostContent :: PostId -> BlogRequest PostContent Then each of these constructors are pattern matched on and processed separately in the match function of the DataSource instance. This style