Currently Stylish Haskell lacks support for psuedo-classes/elements, which is a significant shortcoming. So what would it take?
To start the following psuedoclasses need to be defined by the caller (mostly in implementing forms), either before or after the CSS is evaluated:
The pseudoelements meanwhile need to be applied after selection:
:link, :lang(), & :root/:scope can compile down to existing selectorFuncs.
Furthermore there's those psuedoclasses which tests the position of the element in the list.
Furthermore there's functional psuedoclasses which takes additional arguments:
I'd be tempted to output a structure mapping psuedoclasses to style objects, after having compiled some of those as part of the selector itself. Though the issue with that is that it prevents popular solutions for creating JavaScript-free webpages.
I guess I'd add a psuedoclass field to elements, and there's already a hook where embedders can decide how they want to deal with it.
Sorry this document is a bit rambly!