HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

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, …