Overload function application

I defined a struct like this:

struct MyType
    a::Float64
end

The problem is that I want to use all the functions defined on Float64 on MyType without having to rewrite them all. What is the best way to do this?
My attempt is not very elegant:

|>(a::MyType, f) = MyType(f(a.a)) 

k = MyType(3)
k |> sin # MyType(0.1411200080598672)
sin(k) # ERROR 

I have to use |> always

1 Like

See:

and

2 Likes