> > a. Ease of implementation should never be the first argument;-)
> 
> In the case of basic functionality like the synchronisation
> provided by MVars, ease of implementation and efficiency go
> often hand in hand.  For such a basic structure, efficiency
> matters a lot.

The same points have been made for languages that omit array
bounds checks, or allow side effects everywhere, or have limited
Ints as defaults instead of variable length Integers. 

In line with other parts of ghc (e.g., unsafePerformIO), I would like 
to get the safe operations per default, with access to the unsafe, 
more efficient operations if I am willing to take on the proof obligations.

In other words, if I can show that my program logic guarantees
safe execution (or if I can change my program to enable such a
proof), then I want to be able to use the more efficient putMVar.

But the default should not assume that such proofs exist or introduce
race conditions I can do without.

Claus

PS. There is some ambivalence in Haskell about out-of-range use 
of partial functions. Some cause static type errors, some abort at
runtime, some throw exceptions, some return Nothing in Maybe..



Reply via email to