User talk:Alexey Muranov

"Is an instance" versus "has an instance"
Hello,

While "X is an instance of Y" is the most common phrasing (and, accordingly, I have accepted your edit), it is not wrong to say "X has an instance of Y". The catch is that in "has an instance" the word "instance" refers to the implementations of the class methods (i.e. what you specify when you write an  declaration). That sense is clearer in sentences such as " has an   instance which combines elements in matching positions".

Cheers, Duplode (discuss • contribs) 06:33, 20 April 2017 (UTC)


 * I would say then " implements   interface, where   combines elements in matching positions".  Abbreviated versions look like professional slang to me, unlikely to be understood by a common reader and hardly examples of proper English.  In my understanding, the keyword   in Haskell refers to a type's being an instance of a typeclass.  --Alexey Muranov (discuss • contribs) 09:28, 20 April 2017 (UTC)


 * I wouldn't say it is a question of "proper English" -- there is nothing inherently ungrammatical about "X has an instance of Y" -- but rather of whether the idiom (or "professional slang", if you will) is not outright misleading and is transparent enough to be understood by readers. I believe "has an instance" passes on both counts. This answer on Quora to the question we are discussing frames the issue well:


 * "It's not wrong per se, and I've heard that phrasing used occasionally, but it's more common to say that a type is an instance of a typeclass."


 * Situations in which it is natural to "think of the instances as its own entity" include whenever the dictionary passing mechanics behind instances become relevant, as well as when one is contrasting different instances that a type might be given. As an example of the latter case, consider this passage from the readme of the validation package:


 * "The AccValidation data type is isomorphic to Either, but has an instance of Applicative that accumulates on the error side. That is to say, if two (or more) errors are encountered, they are appended using a Semigroup operation."


 * I wouldn't consider a patch to validation changing that to "[...] but is an instance of Applicative in a way that (<*>) that accumulates on the error side [...]" as an improvement, as it would result in a more convoluted sentence with no real gain in accuracy.


 * Duplode (discuss • contribs) 21:36, 20 April 2017 (UTC)