Markdown on this website is a little weird.
If you want to share a code block, it looks better if you do `
` rather than
``` ... ```
> It's possible something like this could work for finite categories, where you explicitly list out the composition table. But really what we want is to give a list of equations, not a composition table, since AQL schemas are not categories, they are presentations of categories (and many AQL schemas denote infinite categories, for which we can't explicitly list the composition table).
Conal Elliot gives examples of infinite constrained categories in §7.1, §7.4, and §7.5 of his paper.
Here is his git repository where he put the code for his paper: https://github.com/conal/concat
> `-- not sure how Ok works, but only A and B should be Ok`
If you reread §6 of Conal's paper, you see he is using Bolingbroke's *constraint kinds* extension.
Conal cites Bolingbroke's [2011 blog post](http://blog.omega-prime.co.uk/2011/09/10/constraint-kinds-for-ghc/) where the constraint kinds extension was announced.
If you want to use them, you might want to [read the documentation](https://downloads.haskell.org/~ghc/7.8.4/docs/html/users_guide/constraint-kind.html).
I keep getting the feeling you aren't interested in rewriting AQL in Haskell.
That's fine, but please say so.
I also get the sense you really like Java. If so, I am jealous of you. My life as a professional programmer would be easier if I enjoyed Java, rather than merely had the strength to endure it.
(That's a little arrogant, I really *don't* always have the strength to endure it.)