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

Moduleap-normalize-0.1.0.1Haskell2010

ApNormalize.Aps

The definition of Aps. Most of this is reexported by ApNormalize.

  • 1 type
  • 6 values

Normalizing applicative functors

7 declarations
datadata Aps (f :: Type -> Type) a where
#

An applicative functor transformer which accumulates f-actions (things of type f x) in a normal form.

It constructs a value of type f a with the following syntactic invariant. It depends on the number of f-actions a1 ... an composing it, which are delimited using liftAps:

  • Zero action: pure x

  • One action: f <$> a1

  • Two or more actions: liftA2 f a1 a2 <*> a3 <*> ... <*> an

Constructors

Instances2Functor, Applicative
value(<$>^) :: (a -> b) -> f a -> Aps f b
#

f <$>^ u :: Aps f b is a delayed representation of f <$> u :: f b, so that it can be fused with other applicative operations.

f <$>^ u is a shorthand for f <$> liftAps u.

value(<*>^) :: Applicative f => Aps f (a -> b) -> f a -> Aps f b
#

u <*>^ v appends an f-action v to the right of an (Aps f)-action u.

u <*>^ v is a shorthand for u <*> liftAps v.