Determining the variance of the function type 

In this section, we will attempt to understand how to reason about function types. While Julia does not provide too much help in formalizing function types, it does not stop us from doing the analysis ourselves. In some strongly typed, static OOP languages, function types are more formally defined as the combination of method arguments and return type.

Suppose that a function takes three arguments and returns a single value. Then we can describe the function with the following notation:

Let's continue the animal kingdom example and define some new variables and functions, as follows:

female_dogs ...

Get Hands-On Design Patterns and Best Practices with Julia now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.