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

Modulebase-compat-batteries-0.14.1Haskell2010

Data.Functor.Compose.Compat

  • 1 type
newtypenewtype Compose (f :: k -> Type) (g :: k1 -> k) (a :: k1)
#

Right-to-left composition of functors. The composition of applicative functors is always applicative, but the composition of monads is not always a monad.

Examples
Example1 expression
fmap (subtract 1) (Compose (Just [1, 2, 3]))Compose (Just [0,1,2])
Example1 expression
Compose (Just [1, 2, 3]) <> Compose NothingCompose (Just [1,2,3])
Example1 expression
Compose (Just [(++ "World"), (++ "Haskell")]) <*> Compose (Just ["Hello, "])Compose (Just ["Hello, World","Hello, Haskell"])

Constructors

Instances34Generic1, TestEquality, Functor, Applicative, Foldable, Traversable, …