Abstract: An application that fails to ensure information
flow security may leak sensitive data such as passwords, credit
card numbers, or medical records. News stories of such failures
abound. Austin and Flanagan introduce faceted values –
values that present different behavior according to the privilege
of the observer – as a dynamic approach to enforce information flow
policies for an untyped, imperative λ-calculus.
We implement faceted values as a Haskell library, elucidating their
relationship to types and monadic imperative programming. In
contrast to previous work, our approach does not require
modification to the language runtime. In addition to pure faceted
values, our library supports faceted mutable reference cells and
secure facet-aware socket-like communication. This library
guarantees information flow security, independent of any
vulnerabilities or bugs in application code. The library
uses a control monad in the traditional way for encapsulating
effects, but it also uniquely uses a second data monad to
structure faceted values. To illustrate a non-trivial
use of the library, we present a bi-monadic interpreter for a
small language that illustrates the interplay of the control
and data monads.