Folks, A Haskell 98 addendum
Lennart points out that in a fit of enthusiasm I made the
Permissions data type abstract, adding functions for
readable, writable, executable, searchable :: Permissions -> Bool
What I totally failed to notice is that you then
can't *set* the permissions to anything, because there's no
way of constructing a value of type Permissions.
Well, the bits are frozen, but I propose to regard this as a gross
"typo" and add it to the typos page. But what's the fix? One
possibility would be to keep Permissions abstract, and
add more functions, but I think a better thing to do is simply
to revert the change, and make Permissions concrete as it was
before:
data Permissions = Permissions {
readable, writable, executable, searchable :: Bool
}
deriving ( Eq, Ord, Read, Show )
So the "typo" fix I propose is
- eliminate the separate functions readable, writable,
searchable, executable
- make Permissions concrete as above (that of course
adds readable etc back in as field names)
Any objections? I don't want to look foolish a second time!
Simon