[julia-users] Recursive/Circular parametric types

2016-08-23 Thread Ben Ward
I'm doing some development and wondered if this kind of pattern is problematic: abstract AbstractNode abstract PhylogenyNode <: AbstractNode abstract NetworkNode <: AbstractNode abstract AbstractEdge abstract PhylogenyEdge <: AbstractEdge abstract NetworkEdge <: AbstractEdge type Branch{N <: Phy

Re: [julia-users] Recursive/Circular parametric types

2016-08-24 Thread Tim Holy
I don't think that's type-stable. Since each node of each tree will also be a different type, I also think you'll end up hating life due to compile times. There's some (peripherally) relevant discussion at http://docs.julialang.org/ en/latest/manual/performance-tips/#the-dangers-of-abusing-multip

Re: [julia-users] Recursive/Circular parametric types

2016-08-25 Thread Ben Ward
Hi Tim, That's a shame, I was hoping that doing the above would let me create several different concrete PhylogenyNode and PhylogenyEdge types, that can be used together. I guess since this is an abuse I have to pair one concrete PhylogenyEdge type with one concrete PhylogenyNode type? I wonde

Re: [julia-users] Recursive/Circular parametric types

2016-08-25 Thread Tim Holy
That seems likely to work, though obviously some operations will not be inferrable. You might be just as happy with type PhylogenyNode kind::Symbol # :clade, etc. from::PhyologenyEdge to::Vector{PhylogenyEdge} confidence::Float64 end type PhylogenyEdge kind::Symbol # :bran