[Haskell] overuse of maybe and [] in prelude and libs

Simon Marlow simonmar at microsoft.com
Tue Apr 13 16:18:54 EDT 2004

> But, either way, I'm assuming I can't do this
> (making up syntax):
>    import Data.FiniteMap using MyPrelude as Prelude
> So that every place in FiniteMap that Prelude
> functions are called, MyPrelude functions are
> called instead?  Then I could simply redefine just
> and nothing as return and mzero.

Not possible with GHC, I'm afraid.  At least, not at the moment.  We
would have to retain a strong separation between Data.FiniteMap and
Prelude, such as you would do if the Prelude were dynamically linked,
and GHC doesn't do that.  

Indeed, doing so would probably have a significant impact on
performance, because the compiler wouldn't be able to take advantage of
any knowledge about the Prelude except for the types of functions when
compiling Data.FiniteMap.


More information about the Haskell mailing list