Re: [Haskell-cafe] Why are field selectors functions?

2013-08-09 Thread David Banas
Wouldn't the implementation hiding feature of the *newtype *idiom be broken, if field selectors were not first class functions? For instance, the following code (taken shamelessly from Ch. 10 of *Real World Haskell*): module Parse ( runParser ) where data ParseState = ParseState { string

Re: [Haskell-cafe] Why are field selectors functions?

2013-08-08 Thread Jon Fairbairn
AntC anthony_clay...@clear.net.nz writes: No! This isn't more bikeshedding about notation. It's a bit of Haskell archaeology. On Sun, Jun 30, 2013 at 2:59 AM, Judah Jacobson wrote: [This isn't exactly what Judah wrote.] ... Instead of `x f` (to access field x of record f), maybe we