[Haskell-cafe] newtype and access control
allbery.b at gmail.com
Sun Oct 29 23:58:40 UTC 2017
On Sun, Oct 29, 2017 at 7:52 PM, Steven Leiva <leiva.steven at gmail.com>
> Out of necessity, the speaker has to assume a certain level of Haskell
> knowledge that I don't have, because I am confused as to what language
> principles would allow for *inDBTrans* to be used for access control.
As presented, that doesn't seem to be true. If the module exported only the
type constructor, then it would be impossible for other modules to pattern
match it and access the wrapped value. But the module has no export list,
so it exports everything including the data constructor and modules can
pattern match to unwrap it; the only other way to get that kind of
isolation is for the wrapped data type to not be in scope, but that also
doesn't seem to be the case.
brandon s allbery kf8nh sine nomine associates
allbery.b at gmail.com ballbery at sinenomine.net
unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe