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

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

Modulebase-4.22.0.0Haskell2010

Data.Functor.Sum

Sums, lifted to functors.

  • 1 type
  • Packagebase-4.22.0.0
  • Exports1
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceSum.hs
datadata Sum (f :: k -> Type) (g :: k -> Type) (a :: k)
#

Lifted sum of functors.

Examples
Example1 expression
fmap (+1) (InL (Just 1))  :: Sum Maybe [] IntInL (Just 2)
Example1 expression
fmap (+1) (InR [1, 2, 3]) :: Sum Maybe [] IntInR [2,3,4]

Constructors

Instances18Generic1, Functor, Foldable, Traversable, Foldable1, Eq1, …