This works:
    
    
    type
        Node* = concept n
            `==`(n, n) is bool
        
        Graph* = concept g
            var x: Node
            distance(g, x, x) is float
    

Applying it to your example yields:
    
    
    type VectorSpace = concept x, y
      x + y is type(x)
      zero(type(x)) is type(x)
      -x is type(x)
      x - y is type(x)
      var k: Field
      k * x is type(x)
    

Reply via email to