Skip to content

Document differences between Data.{Monoid,Semigroup}.{First,Last}

Bodigrim requested to merge Bodigrim/ghc:document-first into master

It appears that replacing import Data.Monoid with import Data.Semigroup may change runtime behaviour even if you did not touch anything else at all. That's because, on contrary to newtypes like Any / All / Sum / Product, wrappers First and Last actually have different semantics. Documenting this pitfall.

Edited by Bodigrim

Merge request reports