<html><head><style>p{margin-top:0px;margin-bottom:0px;}</style></head><body><!-- --><div style="font-size:10pt; font-family:NanumGothic, ëëęł ë, sans-serif;"><p>e.g. Parallel resistors, serial capacitors, parallel inductors.</p><p> </p><p>EDIT: Corrected typo. </p><p> </p><p>newtype RecipSum a = RecipSum {getRecipSum :: a}</p><p> </p><p>instance Fractional a => Semigroup (RecipSum a) where</p><p> RecipSum x <> RecipSum y = RecipSum (recip (recip x + recip y))</p><p> sconcat (x :| xs) = mconcat (x : xs)</p><p> stimes n (RecipSum x) = RecipSum (x / fromIntegral n) </p><p> </p><p>instance Fractional a => Monoid (RecipSum a) where</p><p> mempty = RecipSum (1 / 0)</p><p> mconcat xs = RecipSum (recip . getSum $ foldMap (Sum . recip . getRecipSum) xs)</p></div>
</body></html><table style='display:none'><tr><td><img src="https://mail.naver.com/readReceipt/notify/?img=JrRCbHFTpz%2FYaqgZKrRZKxKrFot%2FMrK%2FaztlFAu9KoCvKoulK4JSp4tlaxg9pvIo%2BrkSKoU5W4d5W4C5bX0q%2BzkR74FTWx%2FsWz0Sb4JZ16kqtzCCbrR0Wzm5WXiN.gif" border="0"/></td></tr></table>