@josevalim We shouldn't move that to the Wadler module because it has nothing to do with the algebra itself.
Instead it's an optimization that prevents grouping of docentities that are deep enough.
OTOH we can make Wadler.Utils module or something like that which will have all the convinience functions such as brackets/3, group_maybe/2,3, folddoc/2 and leave only the core algebra implementation in Wadler.
I'm not sure what to do about it, but I'm definitely against moving group*_maybe to wadler.ex.
I'll make a longer commentary about group depth optimization in inspect.ex for now and will
wait for your decision on where should we place those functions. Your word is last. :)