byorgey / species

Other
17 stars 1 forks source link

dropQuals is a bit overzealous #3

Closed dmwit closed 6 years ago

dmwit commented 6 years ago

This interaction is a bit confusing:

Math.Combinatorics.Species> structureType partition
": Set Set"

From a brief code dive, it looks like dropQuals, which is supposed to turn something like Math.Combinatorics.Species.Set into just Set, is having a field day with the :.: type constructor.

Reported first on StackOverflow.

byorgey commented 6 years ago

Oh dear. Thanks for the report! dropQuals really shouldn't be a String -> String function. But I don't know if there's a better way to get the information than tyConName which returns a String instead of something more structured.

byorgey commented 6 years ago

It turns out that tyConNames aren't qualified anymore (there's tyConModule if you want to know that part), so dropQuals is completely unnecessary. I took the opportunity to also fix up the display of infix type operators so they are actually displayed infix:

> structureType partition
"Set :.: Set"

Uploaded to Hackage as species-0.4.0.1. Note it still doesn't work with GHC-8.4, that's on my list.