Idiom # 4: Create a function which returns the square of an integer
See programming-idioms.org:
Code
Using a preselected integer type:
Using a type parameter selecting a specific integer type:
Running Example
The version with type parameter can be called with different types: