HORIZON HASKELLDocslts/ghc-9.14.x45dd5372026-10-11Search names, modules, packages, or :: a typeCtrl K

GHC 9.14.1 · lts/ghc-9.14.x · 45dd537 · 2026-10-11

Modulelinear-base-0.8.1

Data.Monoid.Linear.Internal.Semigroup

  • 9 types
  • 1 class
  • 2 values
newtypenewtype First a
#

Beware that Data.Semigroup.First is different from Data.Monoid.First. The former simply returns the first value, so Data.Semigroup.First Nothing <> x = Data.Semigroup.First Nothing. The latter returns the first non-Nothing, thus Data.Monoid.First Nothing <> x = x.

Examples
Example1 expression
First 0 <> First 10First {getFirst = 0}
Example1 expression
sconcat $ First 1 :| [ First n | n <- [2 ..] ]First {getFirst = 1}

Constructors

Instances38Monad, Functor, MonadFix, Applicative, Foldable, Traversable, …
newtypenewtype Last a
#

Beware that Data.Semigroup.Last is different from Data.Monoid.Last. The former simply returns the last value, so x <> Data.Semigroup.Last Nothing = Data.Semigroup.Last Nothing. The latter returns the last non-Nothing, thus x <> Data.Monoid.Last Nothing = x.

Examples
Example1 expression
Last 0 <> Last 10Last {getLast = 10}
Example1 expression
sconcat $ Last 1 :| [ Last n | n <- [2..]]* Hangs forever *

Constructors

Instances38Monad, Functor, MonadFix, Applicative, Foldable, Traversable, …
newtypenewtype All
#

Boolean monoid under conjunction (&&).

All x <> All y = All (x && y)
Examples
Example1 expression
All True <> mempty <> All False)All {getAll = False}
Example1 expression
mconcat (map (\x -> All (even x)) [2,4,6,7,8])All {getAll = False}
Example1 expression
All True <> memptyAll {getAll = True}

Constructors

Instances27Bounded, Eq, Data, Ord, Read, Show, …
  • Bounded AllDefined in ghc-internal-9.1401.0 · GHC.Internal.Data.Semigroup.Internal
  • Eq AllDefined in ghc-internal-9.1401.0 · GHC.Internal.Data.Semigroup.Internal
  • Data AllDefined in ghc-internal-9.1401.0 · GHC.Internal.Data.Data
  • Ord AllDefined in ghc-internal-9.1401.0 · GHC.Internal.Data.Semigroup.Internal
  • Read AllDefined in ghc-internal-9.1401.0 · GHC.Internal.Data.Semigroup.Internal
  • Show AllDefined in ghc-internal-9.1401.0 · GHC.Internal.Data.Semigroup.Internal
  • Generic AllDefined in ghc-internal-9.1401.0 · GHC.Internal.Data.Semigroup.Internal
  • Semigroup AllDefined in ghc-internal-9.1401.0 · GHC.Internal.Data.Semigroup.Internal
  • Monoid AllDefined in ghc-internal-9.1401.0 · GHC.Internal.Data.Semigroup.Internal
  • NFData AllDefined in deepseq-1.5.1.0 · Control.DeepSeq
  • Arbitrary AllDefined in QuickCheck-2.19.0.0 · Test.QuickCheck.Arbitrary
  • CoArbitrary AllDefined in QuickCheck-2.19.0.0 · Test.QuickCheck.Arbitrary
  • Function AllDefined in QuickCheck-2.19.0.0 · Test.QuickCheck.Function
  • Binary AllDefined in binary-0.8.9.3 · Data.Binary.Class
  • Unbox AllDefined in vector-0.13.2.0 · Data.Vector.Unboxed.Base
  • Generic AllDefined in linear-generics-0.2.3 · Generics.Linear.Instances.Base · orphan
  • Monoid AllDefined in linear-base-0.8.1 · Data.Monoid.Linear.Internal.Monoid
  • Consumable AllDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Consumable
  • Dupable AllDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Dupable
  • Movable AllDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Movable
  • Semigroup AllDefined in linear-base-0.8.1 · Data.Monoid.Linear.Internal.Semigroup
  • MVector MVector AllDefined in vector-0.13.2.0 · Data.Vector.Unboxed.Base
  • Vector Vector AllDefined in vector-0.13.2.0 · Data.Vector.Unboxed.Base
  • type Rep All = D1 ('MetaData "All" "GHC.Internal.Data.Semigroup.Internal" "ghc-internal" 'True) (C1 ('MetaCons "All" 'PrefixI 'True) (S1 ('MetaSel ('Just "getAll") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool)))Defined in ghc-internal-9.1401.0 · GHC.Internal.Data.Semigroup.Internal
  • data MVector s AllDefined in vector-0.13.2.0 · Data.Vector.Unboxed.Base
  • data Vector AllDefined in vector-0.13.2.0 · Data.Vector.Unboxed.Base
  • type Rep All = D1 ('MetaData "All" "GHC.Internal.Data.Semigroup.Internal" "ghc-internal" 'True) (C1 ('MetaCons "All" 'PrefixI 'True) (S1 ('MetaSel ('Just "getAll") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool)))Defined in linear-generics-0.2.3 · Generics.Linear.Instances.Base · orphan
newtypenewtype Any
#

Boolean monoid under disjunction (||).

Any x <> Any y = Any (x || y)
Examples
Example1 expression
Any True <> mempty <> Any FalseAny {getAny = True}
Example1 expression
mconcat (map (\x -> Any (even x)) [2,4,6,7,8])Any {getAny = True}
Example1 expression
Any False <> memptyAny {getAny = False}

Constructors

Instances27Bounded, Eq, Data, Ord, Read, Show, …
  • Bounded AnyDefined in ghc-internal-9.1401.0 · GHC.Internal.Data.Semigroup.Internal
  • Eq AnyDefined in ghc-internal-9.1401.0 · GHC.Internal.Data.Semigroup.Internal
  • Data AnyDefined in ghc-internal-9.1401.0 · GHC.Internal.Data.Data
  • Ord AnyDefined in ghc-internal-9.1401.0 · GHC.Internal.Data.Semigroup.Internal
  • Read AnyDefined in ghc-internal-9.1401.0 · GHC.Internal.Data.Semigroup.Internal
  • Show AnyDefined in ghc-internal-9.1401.0 · GHC.Internal.Data.Semigroup.Internal
  • Generic AnyDefined in ghc-internal-9.1401.0 · GHC.Internal.Data.Semigroup.Internal
  • Semigroup AnyDefined in ghc-internal-9.1401.0 · GHC.Internal.Data.Semigroup.Internal
  • Monoid AnyDefined in ghc-internal-9.1401.0 · GHC.Internal.Data.Semigroup.Internal
  • NFData AnyDefined in deepseq-1.5.1.0 · Control.DeepSeq
  • Arbitrary AnyDefined in QuickCheck-2.19.0.0 · Test.QuickCheck.Arbitrary
  • CoArbitrary AnyDefined in QuickCheck-2.19.0.0 · Test.QuickCheck.Arbitrary
  • Function AnyDefined in QuickCheck-2.19.0.0 · Test.QuickCheck.Function
  • Binary AnyDefined in binary-0.8.9.3 · Data.Binary.Class
  • Unbox AnyDefined in vector-0.13.2.0 · Data.Vector.Unboxed.Base
  • Generic AnyDefined in linear-generics-0.2.3 · Generics.Linear.Instances.Base · orphan
  • Monoid AnyDefined in linear-base-0.8.1 · Data.Monoid.Linear.Internal.Monoid
  • Consumable AnyDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Consumable
  • Dupable AnyDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Dupable
  • Movable AnyDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Movable
  • Semigroup AnyDefined in linear-base-0.8.1 · Data.Monoid.Linear.Internal.Semigroup
  • MVector MVector AnyDefined in vector-0.13.2.0 · Data.Vector.Unboxed.Base
  • Vector Vector AnyDefined in vector-0.13.2.0 · Data.Vector.Unboxed.Base
  • type Rep Any = D1 ('MetaData "Any" "GHC.Internal.Data.Semigroup.Internal" "ghc-internal" 'True) (C1 ('MetaCons "Any" 'PrefixI 'True) (S1 ('MetaSel ('Just "getAny") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool)))Defined in ghc-internal-9.1401.0 · GHC.Internal.Data.Semigroup.Internal
  • data MVector s AnyDefined in vector-0.13.2.0 · Data.Vector.Unboxed.Base
  • data Vector AnyDefined in vector-0.13.2.0 · Data.Vector.Unboxed.Base
  • type Rep Any = D1 ('MetaData "Any" "GHC.Internal.Data.Semigroup.Internal" "ghc-internal" 'True) (C1 ('MetaCons "Any" 'PrefixI 'True) (S1 ('MetaSel ('Just "getAny") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool)))Defined in linear-generics-0.2.3 · Generics.Linear.Instances.Base · orphan
newtypenewtype Dual a
#

The dual of a Monoid, obtained by swapping the arguments of (<>).

Dual a <> Dual b == Dual (b <> a)
Examples
Example1 expression
Dual "Hello" <> Dual "World"Dual {getDual = "WorldHello"}
Example1 expression
Dual (Dual "Hello") <> Dual (Dual "World")Dual {getDual = Dual {getDual = "HelloWorld"}}

Constructors

Instances39Monad, Functor, MonadFix, Applicative, Foldable, Traversable, …
newtypenewtype Product a
#

Monoid under multiplication.

Product x <> Product y == Product (x * y)
Examples
Example1 expression
Product 3 <> Product 4 <> memptyProduct {getProduct = 12}
Example1 expression
mconcat [ Product n | n <- [2 .. 10]]Product {getProduct = 3628800}

Constructors

Instances42Monad, Functor, MonadFix, Applicative, Foldable, Traversable, …
newtypenewtype Sum a
#

Monoid under addition.

Sum a <> Sum b = Sum (a + b)
Examples
Example1 expression
Sum 1 <> Sum 2 <> memptySum {getSum = 3}
Example1 expression
mconcat [ Sum n | n <- [3 .. 9]]Sum {getSum = 42}

Constructors

Instances42Monad, Functor, MonadFix, Applicative, Foldable, Traversable, …
newtypenewtype Endo a
#

Constructors

Instances4Monoid, Semigroup
  • Semigroup (Endo a)Defined in linear-base-0.8.1 · Data.Monoid.Linear.Internal.Semigroup
  • Monoid (Endo a)Defined in linear-base-0.8.1 · Data.Monoid.Linear.Internal.Monoid · orphan
  • Monoid (Endo a)Defined in linear-base-0.8.1 · Data.Monoid.Linear.Internal.Monoid
  • Semigroup (Endo a)Defined in linear-base-0.8.1 · Data.Monoid.Linear.Internal.Semigroup
classclass Semigroup a where
#

Methods

  • (<>) :: a %1 -> a %1 -> ainfixr 6
Instances41Semigroup, …