darcs patch: add withFile and withBinaryFile (#966)

Taral taralx at gmail.com
Thu Oct 26 17:05:22 EDT 2006

On 10/26/06, David Roundy <droundy at darcs.net> wrote:
> In case I've been too vague, what I mean is that I'd like it if one could
> ensure that code such as
>   withFile "filename" ReadMode return >>= hGetContents
> statically fails

That's what linear types (e.g. Clean's uniqueness types) are for. You
could use some kind of phantom type thing, but what if multiple files
are in use? It could get really ugly at the type level.

Taral <taralx at gmail.com>
"You can't prove anything."
    -- Gödel's Incompetence Theorem

More information about the Libraries mailing list