Implement with Types, Not Your Brain

Implement with Types, Not Your Brain

Two things:

Using this information, our goal is to write the correct expression in place of the type hole. Our hole has a function type, so let’s introduce a lambda:

We need to produce an again. For example, if you want a function that creates a list with length $n$, where all elements are the same value, then that thing should have type , not .

Source: reasonablypolymorphic.com