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
Then in practice to access the zero value for (say) a float:
echo zero(float)
Is there a more idiomatic way of going about this?