microsoft / qsharp-language

Official repository for design of the quantum programming language Q# and its core libraries
MIT License
235 stars 56 forks source link

Support equality checking on arbitrary types #147

Open cgranade opened 5 years ago

cgranade commented 5 years ago

Is your feature request related to a problem? Please describe. At the moment, the == operator is not supported for values whose type is given by a type parameter (see screenshot from an IQ# session below). Since all types in Q# are value types, however, we should be able to support == between arbitrary types, including type parameters.

Additional context image

bettinaheim commented 4 years ago

Here is roughly the list of things that would need to be done:

Let me know if you are up for picking some of that up.

bamarsha commented 4 years ago

Since there are good reasons to want to avoid defining equality on callable types, but a generic type parameter 'T could potentially be instantiated as a callable type, it looks like this is blocked by microsoft/qsharp-language#149.

bamarsha commented 4 years ago

However, we could probably add equality comparisons for all of the other concrete types relatively easily (excludes callables and type parameters)... maybe that should be a new issue.

alan-geller commented 2 years ago

I'm going to transfer this issue to the qsharp-language repo, since that's now the proper place for language suggestions.