
On Thu, Jun 27, 2013 at 11:24 AM, Patrick Redmond
I noticed that ghci lets me do this:
Not just ghci, but ghc as well.
Yay? I can have a simple type with one constructor named the same as the type. Why is this allowed? Is it useful somehow?
It's convenient for pretty much the situation you showed, where the type constructor and data constructor have the same name. A number of people do advocate that it not be used, though, because it can be confusing for people. (Not for the compiler; data and type constructors can't be used in the same places, it never has trouble keeping straight which is which.) It might be best to consider this as "there is no good reason to *prevent* it from happening, from a language standpoint". -- brandon s allbery kf8nh sine nomine associates allbery.b@gmail.com ballbery@sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net