HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

Modulemonoid-subclasses-1.2.5.1Haskell2010

Data.Monoid.Null

This module defines the MonoidNull class and some of its instances.

  • 2 classes
classclass Monoid m => MonoidNull m where
#

Extension of Monoid that allows testing a value for equality with mempty. The following law must hold:

Property
null x == (x == mempty)

Furthermore, the performance of this method should be constant, i.e., independent of the length of its argument.

Methods

Instances48MonoidNull, …
classclass MonoidNull m => PositiveMonoid m
#

Subclass of Monoid for types whose values have no inverse, with the exception of mempty. More formally, the class instances must satisfy the following law:

Property
null (x <> y) == (null x && null y)
Instances42PositiveMonoid, …