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[T: char](a: Stream[T]) = discard func head[T](stream: seq[T]): T = stream.data[0] func tail[T](stream: seq[T]): seq[T] = stream let a = @['h', 'e', 'l', 'l', 'o'] consumes(a)