The most general polymorphic type signatures and definitions are:
infixr 9 .

(.) :: (b -> c) -> (a -> b) -> a -> c
(f . g) x = f (g x)

zipWith :: (a -> b -> c) -> [a] -> [b] -> [c]
zipWith f (x:xs) (y:ys) = f x y : zipWith f xs ys
zipWith _ _ _ = []

uncurry :: (a -> b -> c) -> (a,b) -> c
uncurry f (x,y) = f x y
Function composition passes the result of the second function into the first. zipWith combines corresponding list elements and stops when either list ends. Uncurrying converts a function taking two successive arguments into one taking a pair. None of these operations needs a numeric or ordering constraint.
Application binds more tightly than function composition, and (.) associates to the right. Let
g :: a -> b -> c
Then y :: a and g y :: b -> c. To compose to its left, h x must have type c -> a, so x :: d and h :: d -> c -> a. The outer occurrence of g receives that a, producing a function of type b -> c. Consequently g . h x . g y has type b -> b -> c, and the principal type is f :: (a -> b -> c) -> (d -> c -> a) -> d -> a -> b -> b -> c. No Haskell type class constraint is introduced.
The required function composition is
unfold p f g = map f . takeWhile (not . p) . iterate g
iterate g supplies the successive states, takeWhile (not . p) retains precisely those before the first stopping state, and map f produces their outputs. If the initial state satisfies the stopping predicate, both sides return the empty list. Otherwise both emit the same head and repeat from g x; the same argument applies to every demanded finite prefix of an infinite result.
The iterated function is for every positive integer . The exponent here denotes repeated function composition, not an ordinary power or a derivative.
For the base case , the formula is the definition. If it holds at , then
This proves the claim by mathematical induction, for every real input .
Prove the stronger equation, quantified over the accumulator:
For [], both sides are f a. For the bottom value, both sides are bottom because f is a strict function. For the cons step, the universal induction hypothesis allows the accumulator to become g a x:
f (foldl g a (x:xs))
 = f (foldl g (g a x) xs)
 = foldl h (f (g a x)) xs
 = foldl h (h (f a) x) xs
 = foldl h (f a) (x:xs).
Thus structural induction proves the claim for finite and finite partial spines; definable continuity extends it to infinite lazy lists. Pointwise equality is exactly the asserted equality of function compositions. This is the left-fold fusion law.
Join either two halves or successive pairs:
unhalve :: ([a],[a]) -> [a]
unhalve (xs,ys) = xs ++ ys

unpairs :: [(a,a)] -> [a]
unpairs = foldr (\(x,y) zs -> x:y:zs) []
By the defining property of splitAt, concatenating the two halves restores the original list. For unpairs, structural induction on the even input proves that its first pair restores its first two elements and the recursive result restores the rest. Thus both requested function compositions are the identity. Fully consuming either result takes at most linear time; list concatenation only copies the left half once.
Permutation Created 2026-09-24 Updated 2026-10-13
A permutation of a set is a bijection : every element has exactly one image and every element appears exactly once as an image. For a finite set, a permutation can also be recorded as an ordering of all its elements, once a reference order has been chosen. For three distinct letters , the six orderings are
There are three choices for the first letter, two unused letters for the second, and one for the third. Every path in the tree gives one complete ordering, and every ordering has one such path, so the rule of product gives , a factorial.
Figure 1.
The full choice tree for the six permutations of three distinct letters: three first choices, two second choices, and one third choice
. Details.
Ordering versus mapping. Label the reference positions . An ordering tuple of these labels describes the function ; conversely, reading the images recovers the ordering. For example,
means , , , . Its ordered image list is , whereas its cycle decomposition of a permutation is : starting at , follow its successive images back to . Parentheses in the latter expression encode arrows around a permutation cycle, rather than an image list in reference order. [ref]
The two viewpoints answer different useful questions about the same object. An ordering tells us which object occupies each position; a bijection tells us where each label is sent and allows successive rearrangements through function composition. All permutations of labels form the symmetric group, whose subgroups are permutation groups. The counting viewpoint supplies possibilities, a factorial; the mapping viewpoint reveals how rearrangements combine.
Composition convention. Apply the rightmost permutation first:
For the displayed and the transposition , direct evaluation gives
For instance, , but . Thus function composition of permutations need not be commutative; the omitted labels in these permutation cycles are fixed points.
For a normal subgroup of , each is a group automorphism of . Its inverse is , but the dependence on is a group antihomomorphism under ordinary function composition, because . The assignment instead is a group homomorphism to the automorphism group. Equivalently the first convention is a right group action, while the second is a left group action.
Ring Created 2026-09-24 Updated 2026-10-14
A ring is a set with two binary operations, addition and multiplication, satisfying three requirements. Under addition, is an abelian group: there is a zero, every element has an inverse element, and grouping or exchanging summands does not change the result. Multiplication is associative and has an identity element , so and . Finally, both versions of the distributive property hold:
Here every ring is unital, but the zero ring, with , is allowed. Commutativity of multiplication is an additional condition defining a commutative ring. These conventions agree with [ref].
The integers form a ring with their usual operations. The polynomial ring is another: addition combines coefficients, while multiplication uses the distributive property. For example,
The same rules justify symbolic calculations in both rings; this is why one definition can organize apparently different kinds of arithmetic. In every ring, , and . The first identity follows by distributing and subtracting ; the second follows by distributing . Thus familiar sign rules are consequences of the structure.
Order still matters in some rings. In the matrix ring , take
Then matrix multiplication gives
Nevertheless, matrix multiplication is associative, distributes over addition, and has the identity matrix as its identity element. This is a valid ring. On a column vector, applies first and second: swapping coordinates before discarding the second coordinate differs from doing those actions in reverse. The failure of commutativity records a meaningful difference in function composition.
Figure 1.
Two orders of matrix multiplication give different outputs on the same vector
. Details.
Sign homomorphism Created 2026-09-24 Updated 2026-10-03
The sign homomorphism sends an even permutation to and an odd permutation to ; its kernel is the alternating group.
A symmetric group is the group of all bijections from a set to itself, with function composition as its operation.
Special Euclidean group 2026-10-25
The group of Euclidean isometries preserving orientation of . Its elements have the form , with in the special orthogonal group and . The function composition law is , the identity element is , and the inverse element is . These formulas prove closure and inverses; function composition supplies associativity. For , is a planar rotation.
Symmetry group Created 2026-10-14 Updated 2026-10-14
A symmetry group collects bijections of an object to itself that preserve a specified structure in both directions, with function composition as the operation. For a geometric object one may require Euclidean distances to be preserved, giving an isometry group; for a graph, one preserves adjacency, giving a graph automorphism group. For an unstructured finite set, every permutation is allowed. The structure to be preserved is part of the definition.
For a square with its usual geometric structure, the symmetry group consists of four rotations and four reflections. These form the dihedral group of group order eight. The existing group action example shows how its eight elements move the vertices of a polygon; changing the object to its edges or a marked configuration changes the group action being studied.[ref]
Specifying the preserved data makes it possible to test a proposed symmetry exactly. After the preserved data are declared, function composition, the identity map, and inverse maps automatically preserve them too. Symmetry transformations therefore form a group, and questions about equivalent configurations become questions about group orbits, stabilizer subgroups, and group homomorphisms. This supplies reusable mathematics for comparing many different kinds of objects.
For two coordinate charts in a topological atlas, the topological transition map is the homeomorphism
Both domains are open sets in Euclidean space. Function composition gives and wherever all three coordinate charts overlap. These identities express consistency of the coordinate descriptions; imposing smooth functions as the coordinate changes gives a smooth atlas.
Transformation monoid 2026-10-14
A transformation monoid is a collection of self-maps of a fixed set that contains the identity function and is closed under function composition. The associative property comes from function composition. A monoid action describes transformations of a set that obey a monoid's multiplication and identity laws.