[Haskell-cafe] Design your modules for qualified import

Xiao-Yong Jin xj2106 at columbia.edu
Mon Jun 9 15:58:28 EDT 2008

"Johan Tibell" <johan.tibell at gmail.com> writes:

> Duncan's recommendation of just taking the part after the last dot
> seems like a good rule of thumb. Doing
> import qualified Data.Map as M
> does gain you much in my opinion. Compare M.empty to emptyM. No
> difference, you still can't deduce the module by just looking at the
> call site.

I would prefer `M.empty' to `emptyM'.  At least, by looking
at `M.empty', you know that this `empty' is from `M' and you
can easily check out what `M' is from the import list.  I
personally always found myself unproductively tracing back
something like `emptyM' to its origin.

> Cheers,
> Johan
    c/*    __o/*
    <\     * (__
    */\      <

More information about the Haskell-Cafe mailing list