
On Thu, Feb 19, 2015 at 10:42 AM, Christopher Done
Right, I see three use-cases:
* Some things are foldable cleanly like monoids, so you can just mconcat [x,y,z] and that'll be inlined (I think). * Other things like x <|> y is not the same as asum [x,y] due to the additional mempty being introduced. You can also use foldl1 kind of functions, but they are partial and therefore not desirable. * Finally, things like <*>, $=, $, ., #/:& (e.g. in HList/vinyl) can't be folded at all, because the types are different.
The third use-case doesn't have a solution that I'm aware of. So this solves that. It also solves the second use-case, which has only a partial (he he) solution. The first use-case is just a bonus. Should I add this clarification to the proposal?
I think this is a half-solution to the third option: https://gist.github.com/aavogt/433969cc83548e1f59ea Rather than adding more syntax, maybe it's better to make polymorphic functions/values easier to create. Writing instances of ApplyAB is a pain, but ghc could help, as it does with this quasiquoter http://lpaste.net/114788. Regards, Adam