tomjaguarpaw / product-profunctors

Other
19 stars 14 forks source link

Constraint synonyms for Default #35

Closed Lysxia closed 6 years ago

Lysxia commented 7 years ago

Provides some constraint synonyms so the users have fewer characters to type with large types (at the cost of UndecidableInstances). See tests for some examples.

I can't see a way to leverage PartialTypeSignatures and work around the issues you encountered in #34.

tomjaguarpaw commented 7 years ago

This is really great.

I'd like to suggest one thing for consideration. It feels like DefaultFields is doing too much. Would it be better to omit Profunctor/ProductProfunctor/SumProfunctor from DefaultFields? Perhaps there could be a different type synonym for it.

Lysxia commented 7 years ago

That sounds good. I'll split DefaultFields.

tomjaguarpaw commented 6 years ago

@Lysxia This was great stuff. Can you split DefaultFields so I can merge your PR?

Lysxia commented 6 years ago

Hi, I think I already did that! (The last commit is after my comment.)

tomjaguarpaw commented 6 years ago

Ah yes! It would be nice to have a ProfunctorType p which picks which of ProductProfunctor and/or SumProfunctor are needed, but that can be done later.

tomjaguarpaw commented 6 years ago

Thanks for this patch. It makes things a lot nicer.

Lysxia commented 6 years ago

DefaultPConstraints resolves to the minimal subset of ProductProfunctor and SumProfunctor for a given generic type.

tomjaguarpaw commented 6 years ago

Thanks! I totally misunderstood how you implemented this because to understand how it worked I only looked at the tests :)

tomjaguarpaw commented 6 years ago

@Lysxia @hesselink Look how nice your Generics PRs made the Opaleye tutorial!

https://github.com/tomjaguarpaw/haskell-opaleye/compare/generic?expand=1

No more TH and just one genericAdaptor that works in all cases!

Lysxia commented 6 years ago

That's great!

hesselink commented 6 years ago

Looks great!