HORIZON HASKELLDocslts/ghc-10.0.x2b276322026-10-31Search packagesCtrl K
Theme: |

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 2b27632 · 2026-10-31

Modulebase-4.23.0.0Haskell2010

Data.Functor.Sum

Sums, lifted to functors.

Synopsis
  • Packagebase-4.23.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, …