I'd like to associate a type-wide constant with a concept in some of my concept 
implementations. Currently I'm doing this:
    
    
    type AddMonoid* = concept x, y, type T
      zero(T) is T
    
    func zero*(x: typedesc[float]): float = 0.0
    func zero*(x: typedesc[int]): int = 0
    
    
    Run

Then in practice to access the zero value for (say) a float:
    
    
    echo zero(float)
    
    
    Run

Is there a more idiomatic way of going about this? 

Reply via email to