[Haskell] -allow-extension-for-bottom

Keith Wansbrough Keith.Wansbrough at cl.cam.ac.uk
Mon Oct 11 07:29:50 EDT 2004

> Dear Haskell implementors,
> Consider the compilation flag  -allow-extension-for-bottom
> which changes the language meaning so that allows to ignore
> the bottom value. For example, the programs
>    (1)   (\ x -> (if p x then  foo (g x)  else  foo (h x)) )
> and
>    (2)   (\ x -> foo ((if p x then  g x  else  h x)) )
> become equivalent, and many program transformations become 
> possible.

Is it not the case that with -allow-extension-for-bottom all programs
are equivalent to

  error "Finished"

and hence not just 1000 times faster but infinitely faster

Seriously, I can see that something like this might be of interest,
but the details are not trivial.  For a start, you'd want to allow
refinements only - from _|_ to non-_|_ - rather than in both
directions, to disallow the above transformation.  But then you'd have
to deal with refinement relations rather than equivalences everywhere
in the theory, losing symmetry and making things more complicated.

--KW 8-)

More information about the Haskell mailing list