@ChrisRackauckas Thanks a lot for your very helpful comment.
I agree with @cc7768 that, in some instances, it’s nice to have type information. At the same time, I like simplicity and readability, so duck typing is also attractive.
Here are some rules I propose:
Point 1: Methods with at least one argument typed should have all arguments typed.
There’s no hard and fast reason for this but typing just some arguments feels odd. For example,
function consol_price(ap::AssetPriceModel, zeta)
# ^^^ Note zeta is not typed
seems less “symmetric” than
function consol_price(ap::AssetPriceModel, zeta::AbstractFloat)
# ^^^ Note zeta is an AbstractFloat now rather than Float64
Point 2: It appears that we’ve been too heavy with concrete types inside method definitions.
Example: Sometimes arguments are required to be
Float64s in the code when they could very well be integers in the model. Let’s shift to
Real in this setting.
Backing off from some of these strict types would seem to address @ChrisRackauckas’s criticism.