Skip to content

Function composition is not higher-rank

Motivation

The $ operator is capable of applying things while preserving their forall-qualifiers.

This allows us to do the following:

type Rule = forall a. Something a

bar :: Rule -> Rule
qux :: Rule -> Rule

foo :: Rule -> Rule
foo x = bar $ qux x

However, the . operator is not, so we can't transform the expression above into:

foo = bar . qux

Proposal

Let make . as polymorphic, as $ is.

Edited by Heimdell
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information