type Stream[T] = concept # interface func head(_: Self): T func tail(_: Self): Self proc display[T](stream: Stream[T]) = stdout.write stream.head stream.tail.display func consumes(a: Stream[char]) = discard type StreamImpl = seq[char] func head(stream: StreamImpl): char = stream[0] func tail(stream: StreamImpl): StreamImpl = stream let a: StreamImpl = @['h', 'e', 'l', 'l', 'o'] consumes(a) # works for what it's worth