At http://julia.readthedocs.org/en/latest/manual/conversion-and-promotion/, there is a discussion about adding integers to floats and so on, and and at the end it says
User-defined types can easily participate in this promotion system by defining methods for conversion to and from other types, and providing a handful of promotion rules defining what types they should promote to when mixed with other types.
From this I inferred that when defining my own numeric type, I simply needed to define how to convert it to a known type for it to work with functions on it. But I tried this and it doesn't seem to work:
julia> type MyType
n::Int
end
julia> convert(::Type{Int}, x::MyType) = x.n
convert (generic function with 1 method)
julia> convert(Int, MyType(1))
1
julia> MyType(1) + 1
ERROR: `+` has no method matching +(::MyType, ::Int64)