How easily extendable is that without the original source (e.g. when using as a library)? From what I can see it looks like if you can't edit the case statements you can't extend the functionality (e.g. expression problem stuff).
However, I'm not a haskell pro, so I don't know if I'm just missing the obvious here.
Very easy! And that's (one reason) why it's written the way it is. Any PrimQueryFold can be extended to a fold on a type which extends PrimQuery with additional constructors.
However, I'm not a haskell pro, so I don't know if I'm just missing the obvious here.