foundation icon indicating copy to clipboard operation
foundation copied to clipboard

Add Semigroup instances

Open ndmitchell opened this issue 8 years ago • 3 comments

At least for String, on newer base versions. Probably for arrays too.

ndmitchell avatar Jun 13 '17 21:06 ndmitchell

I was going to make this quickly now but turn out this is really a bad class that is only >= 8.0 and using other stuff from >= 8.0 only (base's NonEmpty). so that brings lots of compat to write ...

vincenthz avatar Jul 08 '17 08:07 vincenthz

Why not make it only available for people on 8.0 and above? That way you can either use foundation stuff, or if you are on the latest base, the type classes which are floating around anyway "just work".

ndmitchell avatar Jul 08 '17 10:07 ndmitchell

if you don't do the compat work at the class level, then all the deriving need to be #ifdef at every single place you instance/derive Semigroup. this is a one level of magnitude uglier than doing the compat work just like Foundation.Class.Bifunctor.

vincenthz avatar Jul 08 '17 17:07 vincenthz