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.DList

This structure is part of the definition of ApNormalize.Aps.

  • 2 types
  • 2 values

Applicative difference lists

4 declarations
newtypenewtype ApDList (f :: Type -> Type) a
#

Type of applicative difference lists.

An applicative transformer which accumulates f-actions in a left-nested composition using (<*>).

ApDList represents a sequence of f-actions u1 :: f x1, ... un :: f xn as "term with a hole" (_ <*> u1 <*> ... <*> un) :: f r.

That hole must have type _ :: f (x1 -> ... -> un -> r); the variable number of arrows is hidden by existential quantification and continuation passing.

To help ensure that syntactic invariant, the Functor and Applicative instances for ApDList have no constraints. liftApDList is the only function whose signature requires an Applicative f constraint, wrapping each action u inside one (<*>).

Constructors

Instances2Functor, Applicative
valuelowerApDList :: Yoneda f (b -> c) -> ApDList f b -> f c
#

Complete a difference list, filling the hole with the first argument.

newtypenewtype Yoneda (f :: Type -> Type) a
#

A delayed application of fmap which can be fused with an inner fmap or liftA2.

This is the same definition as in the kan-extensions library, but we redefine it to not pay for all the dependencies.

Constructors

  • Yoneda (forall x. (a -> x) -> f x)
Instances1Functor
  • Functor (Yoneda f)Defined in ap-normalize-0.1.0.1 · ApNormalize.DList