
Hi, Am Montag, den 04.02.2019, 08:44 +0000 schrieb Simon Marlow:
The point of "pattern" (I believe) is that we want it to be invisible to the importer whether a constructor name was declared as a pattern synonym or a real data constructor, to allow abstraction and smooth migration of APIs when the concrete representation of a datatype changes. However, it would also make sense to allow "data" instead of "pattern", with exactly the same meaning (import either a data constructor or a pattern synonym with the given name). I wonder why we didn't do that.
I agree that “the better name” should be a synonym for pattern (or the other way around). But I don’t think it should be data, because we write data Bool = True | False and it would be odd if `data Bool` means something different here and in an import statement. “value”, as Eric says, is better. Cheers, Joachim -- Joachim Breitner mail@joachim-breitner.de http://www.joachim-breitner.de/