They work, I've been using somewhat advanced concepts without issue in my 
[neural net 
lib](https://github.com/mratsim/Arraymancer/blob/0a08949030ceb0ca5499f73e4b6bca280bec774d/src/nn_dsl/dsl_types.nim#L63-L68):
    
    
    TrainableLayer*[TT] = concept layer
        block:
          var trainable: false
          for field in fields(layer):
            trainable = trainable or (field is Variable[TT])
          trainable
      
      Conv2DLayer*[TT] = object
        weight*: Variable[TT]
        bias*: Variable[TT]
      LinearLayer*[TT] = object
        weight*: Variable[TT]
        bias*: Variable[TT]
      GRULayer*[TT] = object
        W3s0*, W3sN*: Variable[TT]
        U3s*: Variable[TT]
        bW3s*, bU3s*: Variable[TT]
    
    
    Run

The most advanced used of Concepts is probably 
[Emmy](https://github.com/unicredit/emmy/blob/9351ebeb8ddd985336025388aec3b728c53a0eb0/emmy/structures.nim#L17-L40)
    
    
    type
      AdditiveMonoid* = concept x, y, type T
        x + y is T
        zero(T) is T
      AdditiveGroup* = concept x, y, type T
        T is AdditiveMonoid
        -x is T
        x - y is T
      MultiplicativeMonoid* = concept x, y, type T
        x * y is T
        id(T) is T
      MultiplicativeGroup* = concept x, y, type T
        T is MultiplicativeMonoid
        x / y is T
      Ring* = concept type T
        T is AdditiveGroup
        T is MultiplicativeMonoid
      EuclideanRing* = concept x, y, type T
        T is Ring
        x div y is T
        x mod y is T
      Field* = concept type T
        T is Ring
        T is MultiplicativeGroup
    
    
    Run

but use within the standard lib is still pending but [planned for Iterable and 
Indexable concepts](https://github.com/nim-lang/Nim/issues/7996) though I'm 
worried about [compilation time (that I did not experience 
yet)](https://github.com/nim-lang/Nim/issues/9422#issuecomment-430965729)

Reply via email to